commit 8da8a07

delthas  ·  2026-03-11 09:18:50 +0000 UTC
parent fcccab1
Don't register click event for ACTION/NOTICE nicks

Clicking the nick column on an ACTION message (displayed as "*") would
try to open a buffer for "*", which is not a valid user.

Simplified alternative to https://github.com/delthas/senpai/pull/2

Co-authored-by: sewn <sewn@disroot.org>
Fixes: https://todo.sr.ht/~delthas/senpai/242
1 files changed,  +1, -1
+1, -1
1@@ -1256,7 +1256,7 @@ func (bs *BufferList) DrawTimeline(ui *UI, x0, y0, nickColWidth int) {
2 				lastHead = lastHead[line.Head.styles[len(line.Head.styles)-1].Start:]
3 			}
4 
5-			if !strings.HasSuffix(lastHead, "--") && !strings.HasSuffix(lastHead, "!!") {
6+			if !strings.HasSuffix(lastHead, "--") && !strings.HasSuffix(lastHead, "!!") && lastHead != "*" {
7 				ui.clickEvents = append(ui.clickEvents, clickEvent{
8 					xb: xb,
9 					xe: xe,