From b87e1a867bf2b36db895d7ef5c0696ae76a5ec66 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Sun, 10 Mar 2024 21:04:00 +0100 Subject: [PATCH] fix: prevent empty selection on double click ot of bounds --- src/tui/editor.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tui/editor.zig b/src/tui/editor.zig index 089f0e7..22d639c 100644 --- a/src/tui/editor.zig +++ b/src/tui/editor.zig @@ -2435,6 +2435,7 @@ pub const Editor = struct { fn select_word_at_cursor(self: *Self, cursel: *CurSel) !*Selection { const root = try self.buf_root(); const sel = cursel.enable_selection(); + defer cursel.check_selection(); sel.normalize(); try move_cursor_word_begin(root, &sel.begin); try move_cursor_word_end(root, &sel.end);