commit 41663622338bad44dd7fc062e30501dc01f00d95
parent 9e21474b2a2400fde07b6276f803cab52e863a65
Author: Martin Ashby <martin@ashbysoft.com>
Date: Sat, 20 Jan 2024 20:07:13 +0000
Fix a bug with cursor movement
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main.zig b/src/main.zig
@@ -421,7 +421,7 @@ fn editorMoveCursor(key: editorKey, es: *EditorState) void {
es.cx_t = es.erow[es.cy].chars.len;
}
} else {
- if (es.cx_t == std.math.maxInt(usize)) {
+ if (es.cx_t >= es.erow[es.cy].chars.len) {
es.cx_t = es.erow[es.cy].chars.len - 1;
} else {
es.cx_t -= 1;