mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-30 03:23:08 +03:00
Add range selection ability on list contexts
This adds range select ability in two ways: 1) Sticky: like what we already have with the staging view i.e. press v then use arrow keys 2) Non-sticky: where you just use shift+up/down to expand the range The state machine works like this: (no range, press 'v') -> sticky range (no range, press arrow) -> no range (no range, press shift+arrow) -> nonsticky range (sticky range, press 'v') -> no range (sticky range, press arrow) -> sticky range (sticky range, press shift+arrow) -> nonsticky range (nonsticky range, press 'v') -> no range (nonsticky range, press arrow) -> no range (nonsticky range, press shift+arrow) -> nonsticky range
This commit is contained in:
@ -75,14 +75,9 @@ func (self *PatchExplorerController) GetKeybindings(opts types.KeybindingsOpts)
|
||||
Handler: self.withRenderAndFocus(self.HandleNextHunk),
|
||||
},
|
||||
{
|
||||
Key: opts.GetKey(opts.Config.Main.ToggleDragSelect),
|
||||
Key: opts.GetKey(opts.Config.Universal.ToggleRangeSelect),
|
||||
Handler: self.withRenderAndFocus(self.HandleToggleSelectRange),
|
||||
Description: self.c.Tr.ToggleDragSelect,
|
||||
},
|
||||
{
|
||||
Key: opts.GetKey(opts.Config.Main.ToggleDragSelectAlt),
|
||||
Handler: self.withRenderAndFocus(self.HandleToggleSelectRange),
|
||||
Description: self.c.Tr.ToggleDragSelect,
|
||||
Description: self.c.Tr.ToggleRangeSelect,
|
||||
},
|
||||
{
|
||||
Key: opts.GetKey(opts.Config.Main.ToggleSelectHunk),
|
||||
|
Reference in New Issue
Block a user