fix: don't auto_find on a single space
This is rarely useful and feels spammy.
This commit is contained in:
parent
c6c310b9d0
commit
a9ee5321ac
1 changed files with 2 additions and 0 deletions
|
|
@ -1496,6 +1496,8 @@ pub fn handle_editor_event(self: *Self, _: tp.pid_ref, m: tp.message) tp.result
|
||||||
const text = editor.get_selection(sel, self.allocator) catch return self.clear_auto_find(editor);
|
const text = editor.get_selection(sel, self.allocator) catch return self.clear_auto_find(editor);
|
||||||
if (text.len == 0)
|
if (text.len == 0)
|
||||||
return self.clear_auto_find(editor);
|
return self.clear_auto_find(editor);
|
||||||
|
if (text.len == 1 and (text[0] == ' '))
|
||||||
|
return self.clear_auto_find(editor);
|
||||||
if (!self.is_last_match_text(text))
|
if (!self.is_last_match_text(text))
|
||||||
tp.self_pid().send(.{ "cmd", "find_query", .{ text, "auto_find" } }) catch return;
|
tp.self_pid().send(.{ "cmd", "find_query", .{ text, "auto_find" } }) catch return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue