mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-08-06 11:02:41 +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:
8
vendor/github.com/jesseduffield/gocui/tcell_driver.go
generated
vendored
8
vendor/github.com/jesseduffield/gocui/tcell_driver.go
generated
vendored
@@ -300,6 +300,14 @@ func (g *Gui) pollEvent() GocuiEvent {
|
||||
mod = 0
|
||||
ch = rune(0)
|
||||
k = tcell.KeyCtrlSpace
|
||||
} else if mod == tcell.ModShift && k == tcell.KeyUp {
|
||||
mod = 0
|
||||
ch = rune(0)
|
||||
k = tcell.KeyF62
|
||||
} else if mod == tcell.ModShift && k == tcell.KeyDown {
|
||||
mod = 0
|
||||
ch = rune(0)
|
||||
k = tcell.KeyF63
|
||||
} else if mod == tcell.ModCtrl || mod == tcell.ModShift {
|
||||
// remove Ctrl or Shift if specified
|
||||
// - shift - will be translated to the final code of rune
|
||||
|
Reference in New Issue
Block a user