commit f5befdb

delthas  ·  2025-03-17 22:54:48 +0000 UTC
parent fcd6b14
Fix incorrect cursor position when editing mutli-line text

Thanks to valr for finding the issue.

Fixes: https://todo.sr.ht/~delthas/senpai/199
1 files changed,  +3, -0
+3, -0
 1@@ -48,6 +48,9 @@ func stringWidth(vx *Vaxis, s string) int {
 2 		return len(s)
 3 	}
 4 	if len(s) == 1 { // Single-character ASCII fast path
 5+		if s[0] == '\n' { // Replaced with ↲
 6+			return 1
 7+		}
 8 		if s[0] <= 0x1F {
 9 			return 0
10 		}