refactor: make delete_word_left less greedy at beginning of line

This commit is contained in:
CJ van den Berg 2026-01-12 19:16:13 +01:00
parent 7dab15da20
commit da942fe640
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -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