~delthas/senpai-dev

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch

[PATCH] ScrollUpHighlight: Correctly handle messages that span multiple lines

Details
Message ID
<20240915211730.2105-2-yyp@disroot.org>
DKIM signature
pass
Download raw message
Patch: +3 -2
---
 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
Reply to thread Export thread (mbox)