~delthas/senpai-dev

ScrollUpHighlight: Correctly handle messages that span multiple lines v1 PROPOSED

Alexey Yerin: 1
 ScrollUpHighlight: Correctly handle messages that span multiple lines

 1 files changed, 3 insertions(+), 2 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~delthas/senpai-dev/patches/55051/mbox | git am -3
Learn more about email & git

[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