No mouse scrolling when scrolling is turned off.

This commit is contained in:
Oliver 2024-03-07 18:21:37 +01:00
parent e4a85fc779
commit 9c17885289
1 changed files with 6 additions and 0 deletions

View File

@ -1399,10 +1399,16 @@ func (t *TextView) MouseHandler() func(action MouseAction, event *tcell.EventMou
} }
consumed = true consumed = true
case MouseScrollUp: case MouseScrollUp:
if !t.scrollable {
break
}
t.trackEnd = false t.trackEnd = false
t.lineOffset-- t.lineOffset--
consumed = true consumed = true
case MouseScrollDown: case MouseScrollDown:
if !t.scrollable {
break
}
t.lineOffset++ t.lineOffset++
if len(t.lineIndex)-t.lineOffset < height { if len(t.lineIndex)-t.lineOffset < height {
// If we scroll to the end, turn on tracking. // If we scroll to the end, turn on tracking.