From 2266c92eab20bbd0dc0d7925f35058963fbfe7db Mon Sep 17 00:00:00 2001 From: xoxorwr Date: Sun, 22 Feb 2026 08:21:21 +0100 Subject: [PATCH] word left stops before newline when moved from other line --- src/tui/editor.zig | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/tui/editor.zig b/src/tui/editor.zig index 155b685..bdac85a 100644 --- a/src/tui/editor.zig +++ b/src/tui/editor.zig @@ -3672,6 +3672,11 @@ pub const Editor = struct { } pub fn move_cursor_word_left(root: Buffer.Root, cursor: *Cursor, metrics: Buffer.Metrics) error{Stop}!void { + if (cursor.col == 0) { + cursor.move_up(root, metrics) catch return; + cursor.move_end(root, metrics); + return; + } try move_cursor_left(root, cursor, metrics); move_cursor_left_until(root, cursor, is_word_boundary_left, metrics); }