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
case MouseScrollUp:
if !t.scrollable {
break
}
t.trackEnd = false
t.lineOffset--
consumed = true
case MouseScrollDown:
if !t.scrollable {
break
}
t.lineOffset++
if len(t.lineIndex)-t.lineOffset < height {
// If we scroll to the end, turn on tracking.