From da942fe64026159cedeba8bb6d5ba5b0c331acdf Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Mon, 12 Jan 2026 19:16:13 +0100 Subject: [PATCH] refactor: make delete_word_left less greedy at beginning of line --- src/tui/editor.zig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/tui/editor.zig b/src/tui/editor.zig index 051c259..005887e 100644 --- a/src/tui/editor.zig +++ b/src/tui/editor.zig @@ -3427,6 +3427,10 @@ pub const Editor = struct { } fn move_cursor_word_left_space(root: Buffer.Root, cursor: *Cursor, metrics: Buffer.Metrics) error{Stop}!void { + if (is_eol_left(root, cursor, metrics)) { + try move_cursor_left(root, cursor, metrics); + return; + } try move_cursor_left(root, cursor, metrics); var next = cursor.*; next.move_left(root, metrics) catch