From cbab1f2fd9bc0eac557c49029c6ba8590ce80b35 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Mon, 10 Nov 2025 12:13:57 +0100 Subject: [PATCH] fix: add_cursor_next_match should move current cursor if there is no selection --- src/tui/editor.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tui/editor.zig b/src/tui/editor.zig index a85f13d..27b014c 100644 --- a/src/tui/editor.zig +++ b/src/tui/editor.zig @@ -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();