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

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

View file

@ -3553,7 +3553,8 @@ pub const Editor = struct {
if (self.matches.items.len == 0) return; if (self.matches.items.len == 0) return;
try self.send_editor_jump_source(); try self.send_editor_jump_source();
while (self.get_next_match(self.get_primary().cursor)) |match| { while (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 primary = self.get_primary();
const root = self.buf_root() catch return; const root = self.buf_root() catch return;
primary.selection = match.to_selection(); primary.selection = match.to_selection();