[PATCH] ScrollUpHighlight: Correctly handle messages that span multiple lines
Export this patch
---
ui/buffers.go | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/ui/buffers.go b/ui/buffers.go
index 6d1cc70..b6b852f 100644
--- a/ui/buffers.go
+++ b/ui/buffers.go
@@ -640,11 +640,12 @@ func (bs *BufferList) ScrollUpHighlight() bool {
y := 0
for i := len(b.lines) - 1; 0 <= i; i-- {
line := &b.lines[i]
+ height := len(line.NewLines(bs.ui.vx, bs.textWidth)) + 1
if ymin <= y && line.Highlight {
- b.scrollAmt = y - bs.tlHeight + 1
+ b.scrollAmt = y - bs.tlHeight + height
return true
}
- y += len(line.NewLines(bs.ui.vx, bs.textWidth)) + 1
+ y += height
}
return false
}
--
2.46.1