fix: cancel completion on update in automatic completion mode
If completion is automatically triggered (the default), then it also makes sense to automatically cancel completions in situations where a completion update would be required and we are *not* expected to automatically re-trigger.
This commit is contained in:
parent
4a97bd8774
commit
e26d86eca3
2 changed files with 17 additions and 0 deletions
|
|
@ -381,6 +381,9 @@ const cmds = struct {
|
|||
const Result = command.Result;
|
||||
|
||||
pub fn update_completion(self: *Type, _: Ctx) Result {
|
||||
if (tui.config().completion_trigger == .automatic and self.value.editor.get_last_trigger_char() == null)
|
||||
return tp.self_pid().send(.{ "cmd", "palette_menu_cancel" }) catch |e| self.logger.err(module_name, e);
|
||||
|
||||
clear_entries(self);
|
||||
self.longest_hint = try load_entries(self);
|
||||
try update_query_text(self, self.value.editor.get_primary().cursor);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue