fix: prevent empty selection on double click ot of bounds
This commit is contained in:
parent
1b8e61dc7a
commit
b87e1a867b
1 changed files with 1 additions and 0 deletions
|
@ -2435,6 +2435,7 @@ pub const Editor = struct {
|
||||||
fn select_word_at_cursor(self: *Self, cursel: *CurSel) !*Selection {
|
fn select_word_at_cursor(self: *Self, cursel: *CurSel) !*Selection {
|
||||||
const root = try self.buf_root();
|
const root = try self.buf_root();
|
||||||
const sel = cursel.enable_selection();
|
const sel = cursel.enable_selection();
|
||||||
|
defer cursel.check_selection();
|
||||||
sel.normalize();
|
sel.normalize();
|
||||||
try move_cursor_word_begin(root, &sel.begin);
|
try move_cursor_word_begin(root, &sel.begin);
|
||||||
try move_cursor_word_end(root, &sel.end);
|
try move_cursor_word_end(root, &sel.end);
|
||||||
|
|
Loading…
Add table
Reference in a new issue