fix: check selection before insert
This commit is contained in:
parent
7963e20058
commit
8476f613c2
1 changed files with 1 additions and 0 deletions
|
@ -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 {
|
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;
|
var root_ = if (cursel.selection) |_| try self.delete_selection(root, cursel, allocator) else root;
|
||||||
const cursor = &cursel.cursor;
|
const cursor = &cursel.cursor;
|
||||||
const begin = cursel.cursor;
|
const begin = cursel.cursor;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue