fix: add_cursor_next_match should move current cursor if there is no selection

This commit is contained in:
CJ van den Berg 2025-11-10 12:13:57 +01:00
parent 185e081c7c
commit cbab1f2fd9
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -3535,7 +3535,8 @@ pub const Editor = struct {
self.with_cursors_const_once(root, move_cursor_word_begin) catch {};
try self.with_selections_const_once(root, move_cursor_word_end);
} else if (self.get_next_match(self.get_primary().cursor)) |match| {
try self.push_cursor();
if (self.get_primary().selection) |_|
try self.push_cursor();
const primary = self.get_primary();
const root = self.buf_root() catch return;
primary.selection = match.to_selection();