summaryrefslogtreecommitdiffstats
path: root/pkg/gui/layout.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2024-01-02 12:19:31 +1100
committerJesse Duffield <jessedduffield@gmail.com>2024-01-28 08:33:13 +1100
commit0f9d9e13d12d37ab419efccc5c217422fb67a765 (patch)
tree35fc5bdc4473da8a6750ee621e270b9e595520c9 /pkg/gui/layout.go
parentc07b3fad64ca71bc1873bcc1bb9e2256c05d4df0 (diff)
Show mode-specific keybinding suggestions
As part of making lazygit more discoverable, there are certain keys which you almost certainly need to press when you're in a given mode e.g. 'v' to paste commits when cherry-picking. This commit prominently shows these keybinding suggestions alongside the others in the option view. I'm using the same colours for these keybindings as is associated with the mode elsewhere e.g. yellow for rebasing and cyan for cherry-picking. The cherry-picking one is a bit weird because we also use cyan text to show loaders and app status at the bottom left so it may be confusing, but I haven't personally found it awkward from having tested it out myself. Previously we would render these options whenever a new context was activated, but now that we need to re-render options whenever a mode changes, I'm instead rendering them on each screen re-render (i.e. in the layout function). Given how cheap it is to render this text, I think it's fine performance-wise.
Diffstat (limited to 'pkg/gui/layout.go')
-rw-r--r--pkg/gui/layout.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/pkg/gui/layout.go b/pkg/gui/layout.go
index 02c74b023..823dfe994 100644
--- a/pkg/gui/layout.go
+++ b/pkg/gui/layout.go
@@ -165,6 +165,8 @@ func (gui *Gui) layout(g *gocui.Gui) error {
return err
}
+ gui.renderContextOptionsMap()
+
outer:
for {
select {