mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-08-06 22:33:07 +02:00
Change the "toggle hunk selection" binding description to be dynamic
When the useHunkModeInStagingView config is on and you enter the staging view with hunk selection enabled, it is confusing to see "a: Select hunk" in the options view at the bottom.
This commit is contained in:
@ -95,9 +95,15 @@ func (self *PatchExplorerController) GetKeybindings(opts types.KeybindingsOpts)
|
||||
Description: self.c.Tr.ToggleRangeSelect,
|
||||
},
|
||||
{
|
||||
Key: opts.GetKey(opts.Config.Main.ToggleSelectHunk),
|
||||
Handler: self.withRenderAndFocus(self.HandleToggleSelectHunk),
|
||||
Description: self.c.Tr.ToggleSelectHunk,
|
||||
Key: opts.GetKey(opts.Config.Main.ToggleSelectHunk),
|
||||
Handler: self.withRenderAndFocus(self.HandleToggleSelectHunk),
|
||||
Description: self.c.Tr.ToggleSelectHunk,
|
||||
DescriptionFunc: func() string {
|
||||
if state := self.context.GetState(); state != nil && state.SelectingHunk() {
|
||||
return self.c.Tr.SelectLineByLine
|
||||
}
|
||||
return self.c.Tr.SelectHunk
|
||||
},
|
||||
Tooltip: self.c.Tr.ToggleSelectHunkTooltip,
|
||||
DisplayOnScreen: true,
|
||||
},
|
||||
|
Reference in New Issue
Block a user