fix: extend the correct end of the selection in move_cursor_prev_word_start_extend

This commit is contained in:
CJ van den Berg 2025-11-27 20:24:53 +01:00
parent c65a4af30a
commit f964296051
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -601,8 +601,7 @@ fn move_cursor_prev_word_start_extend(root: Buffer.Root, cursel: *CurSel, metric
var selection = cursel.selection;
// check if we already had a selection and extend it
defer if (selection) |*pre_sel| {
pre_sel.normalize();
if (cursel.selection) |*sel| sel.end = pre_sel.end;
if (cursel.selection) |*sel| sel.begin = pre_sel.begin;
};
try move_cursor_prev_word_start(root, cursel, metrics);
}