refactor: cancel completion if lsp returns no suggestions

This commit is contained in:
CJ van den Berg 2026-01-30 13:58:00 +01:00
parent 29ac7849c7
commit a21db7b220
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -356,6 +356,11 @@ const cmds = struct {
const Result = command.Result;
pub fn update_completion(self: *Type, _: Ctx) Result {
if (self.value.editor.completions.data.items.len == 0) {
tp.self_pid().send(.{ "cmd", "palette_menu_cancel" }) catch |e| self.logger.err(module_name, e);
return;
}
clear_entries(self);
_ = try load_entries(self);
}