mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-08-06 22:33:07 +02:00
Fix display of panel jump keys for disabled bindings
This commit is contained in:
@ -205,9 +205,15 @@ func (gui *Gui) configureViewProperties() {
|
|||||||
gui.Views.CommitDescription.TextArea.AutoWrapWidth = gui.c.UserConfig().Git.Commit.AutoWrapWidth
|
gui.Views.CommitDescription.TextArea.AutoWrapWidth = gui.c.UserConfig().Git.Commit.AutoWrapWidth
|
||||||
|
|
||||||
if gui.c.UserConfig().Gui.ShowPanelJumps {
|
if gui.c.UserConfig().Gui.ShowPanelJumps {
|
||||||
|
keyToTitlePrefix := func(key string) string {
|
||||||
|
if key == "<disabled>" {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
return fmt.Sprintf("[%s]", key)
|
||||||
|
}
|
||||||
jumpBindings := gui.c.UserConfig().Keybinding.Universal.JumpToBlock
|
jumpBindings := gui.c.UserConfig().Keybinding.Universal.JumpToBlock
|
||||||
jumpLabels := lo.Map(jumpBindings, func(binding string, _ int) string {
|
jumpLabels := lo.Map(jumpBindings, func(binding string, _ int) string {
|
||||||
return fmt.Sprintf("[%s]", binding)
|
return keyToTitlePrefix(binding)
|
||||||
})
|
})
|
||||||
|
|
||||||
gui.Views.Status.TitlePrefix = jumpLabels[0]
|
gui.Views.Status.TitlePrefix = jumpLabels[0]
|
||||||
|
Reference in New Issue
Block a user