mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-05 00:59:19 +02:00
update view cursor when selecting new line in patch explorer view
This commit is contained in:
19
vendor/github.com/jesseduffield/gocui/gui.go
generated
vendored
19
vendor/github.com/jesseduffield/gocui/gui.go
generated
vendored
@ -1226,8 +1226,10 @@ func (g *Gui) onKey(ev *GocuiEvent) error {
|
||||
newCx = lastCharForLine
|
||||
}
|
||||
}
|
||||
if err := v.SetCursor(newCx, newCy); err != nil {
|
||||
return err
|
||||
if !IsMouseScrollKey(ev.Key) {
|
||||
if err := v.SetCursor(newCx, newCy); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if IsMouseKey(ev.Key) {
|
||||
@ -1289,6 +1291,19 @@ func IsMouseKey(key interface{}) bool {
|
||||
}
|
||||
}
|
||||
|
||||
func IsMouseScrollKey(key interface{}) bool {
|
||||
switch key {
|
||||
case
|
||||
MouseWheelUp,
|
||||
MouseWheelDown,
|
||||
MouseWheelLeft,
|
||||
MouseWheelRight:
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// execKeybindings executes the keybinding handlers that match the passed view
|
||||
// and event. The value of matched is true if there is a match and no errors.
|
||||
func (g *Gui) execKeybindings(v *View, ev *GocuiEvent) (matched bool, err error) {
|
||||
|
Reference in New Issue
Block a user