1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

Improve keybinding descriptions

This adds a bunch of tooltips to keybindings and updates some keybinding descriptions (i.e. labels).

It's in preparation for displaying more keybindings on-screen (in the bottom right of the screen),
and so due in part to laziness it shortens some descriptions so that we don't need to manage both
a short and long description (for on-screen vs in-menu). Nonetheless I've added a ShortDescription
field for when we do want to have both a short and long description.

You'll notice that some keybindings I deemed unworthy of the options view have longer descriptions,
because I could get away with it.
This commit is contained in:
Jesse Duffield
2024-01-02 14:00:36 +11:00
parent 0aa6109d4d
commit 7bddf53223
43 changed files with 2525 additions and 2199 deletions

View File

@ -1,6 +1,9 @@
package types
import "github.com/jesseduffield/gocui"
import (
"github.com/jesseduffield/gocui"
"github.com/jesseduffield/lazygit/pkg/gui/style"
)
type Key interface{} // FIXME: find out how to get `gocui.Key | rune`
@ -8,20 +11,22 @@ type Key interface{} // FIXME: find out how to get `gocui.Key | rune`
// is only handled if the given view has focus, or handled globally if the view
// is ""
type Binding struct {
ViewName string
Handler func() error
Key Key
Modifier gocui.Modifier
Description string
Alternative string
Tag string // e.g. 'navigation'. Used for grouping things in the cheatsheet
OpensMenu bool
ViewName string
Handler func() error
Key Key
Modifier gocui.Modifier
Description string
ShortDescription string
Alternative string
Tag string // e.g. 'navigation'. Used for grouping things in the cheatsheet
OpensMenu bool
// If true, the keybinding will appear at the bottom of the screen. If
// the given view has no bindings with Display: true, the default keybindings
// will be displayed instead.
// TODO: implement this
Display bool
Display bool
DisplayStyle *style.TextStyle
// to be displayed if the keybinding is highlighted from within a menu
Tooltip string