mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-05 00:59:19 +02:00
allow scrolling when staging lines or building patch
This commit is contained in:
24
vendor/github.com/jesseduffield/gocui/tcell_driver.go
generated
vendored
24
vendor/github.com/jesseduffield/gocui/tcell_driver.go
generated
vendored
@ -177,6 +177,8 @@ func pollEvent() GocuiEvent {
|
||||
mouseKey = MouseWheelRight
|
||||
}
|
||||
|
||||
wheeling := mouseKey == MouseWheelUp || mouseKey == MouseWheelDown || mouseKey == MouseWheelLeft || mouseKey == MouseWheelRight
|
||||
|
||||
// process button events (not wheel events)
|
||||
button &= tcell.ButtonMask(0xff)
|
||||
if button != tcell.ButtonNone && lastMouseKey == tcell.ButtonNone {
|
||||
@ -210,17 +212,19 @@ func pollEvent() GocuiEvent {
|
||||
}
|
||||
}
|
||||
|
||||
switch dragState {
|
||||
case NOT_DRAGGING:
|
||||
return GocuiEvent{Type: eventNone}
|
||||
// if we haven't released the left mouse button and we've moved the cursor then we're dragging
|
||||
case MAYBE_DRAGGING:
|
||||
if x != lastX || y != lastY {
|
||||
dragState = DRAGGING
|
||||
if !wheeling {
|
||||
switch dragState {
|
||||
case NOT_DRAGGING:
|
||||
return GocuiEvent{Type: eventNone}
|
||||
// if we haven't released the left mouse button and we've moved the cursor then we're dragging
|
||||
case MAYBE_DRAGGING:
|
||||
if x != lastX || y != lastY {
|
||||
dragState = DRAGGING
|
||||
}
|
||||
case DRAGGING:
|
||||
mouseMod = ModMotion
|
||||
mouseKey = MouseLeft
|
||||
}
|
||||
case DRAGGING:
|
||||
mouseMod = ModMotion
|
||||
mouseKey = MouseLeft
|
||||
}
|
||||
|
||||
return GocuiEvent{
|
||||
|
Reference in New Issue
Block a user