refactor: allow updating of completions

This commit is contained in:
CJ van den Berg 2026-01-29 20:59:49 +01:00
parent 725862a394
commit 94aa462a8d
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
4 changed files with 70 additions and 20 deletions

View file

@ -1198,7 +1198,8 @@ const cmds = struct {
var file_path_buf: [std.fs.max_path_bytes]u8 = undefined;
file_path = project_manager.normalize_file_path(file_path, &file_path_buf);
if (self.get_active_editor()) |editor| if (std.mem.eql(u8, file_path, editor.file_path orelse "")) {
if (editor.completions.items.len > 0) {
const have_completions = try editor.add_completion_done();
if (have_completions) {
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),