fix: do not trigger completion if no completions are available
closes #455
This commit is contained in:
parent
cfd3d3db16
commit
dcc196bf25
1 changed files with 6 additions and 4 deletions
|
|
@ -1176,11 +1176,13 @@ const cmds = struct {
|
|||
})) return error.InvalidAddDiagnosticArgument;
|
||||
file_path = project_manager.normalize_file_path(file_path);
|
||||
if (self.get_active_editor()) |editor| if (std.mem.eql(u8, file_path, editor.file_path orelse "")) {
|
||||
switch (tui.config().completion_style) {
|
||||
.palette => try tui.open_overlay(@import("mode/overlay/completion_palette.zig").Type),
|
||||
.dropdown => try tui.open_overlay(@import("mode/overlay/completion_dropdown.zig").Type),
|
||||
if (editor.completions.items.len > 0) {
|
||||
switch (tui.config().completion_style) {
|
||||
.palette => try tui.open_overlay(@import("mode/overlay/completion_palette.zig").Type),
|
||||
.dropdown => try tui.open_overlay(@import("mode/overlay/completion_dropdown.zig").Type),
|
||||
}
|
||||
tui.need_render();
|
||||
}
|
||||
tui.need_render();
|
||||
};
|
||||
}
|
||||
pub const add_completion_done_meta: Meta = .{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue