From 8476f613c24fb763f46e226702e35127f527db57 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Thu, 2 Oct 2025 22:49:02 +0200 Subject: [PATCH] fix: check selection before insert --- src/tui/editor.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tui/editor.zig b/src/tui/editor.zig index 6d15a20..3b669e7 100644 --- a/src/tui/editor.zig +++ b/src/tui/editor.zig @@ -2632,6 +2632,7 @@ pub const Editor = struct { } pub fn insert(self: *Self, root: Buffer.Root, cursel: *CurSel, s: []const u8, allocator: Allocator) !Buffer.Root { + cursel.check_selection(root, self.metrics); var root_ = if (cursel.selection) |_| try self.delete_selection(root, cursel, allocator) else root; const cursor = &cursel.cursor; const begin = cursel.cursor;