From 721370d1ba3edc86b2c5ba2bc742b16d7b7140a5 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Wed, 28 Jan 2026 21:38:59 +0100 Subject: [PATCH] fix: completion de-duplication should not require LSP to send sort text fixes #472 --- src/tui/mode/overlay/completion_dropdown.zig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tui/mode/overlay/completion_dropdown.zig b/src/tui/mode/overlay/completion_dropdown.zig index 41ff77b..7156333 100644 --- a/src/tui/mode/overlay/completion_dropdown.zig +++ b/src/tui/mode/overlay/completion_dropdown.zig @@ -54,8 +54,9 @@ pub fn load_entries(self: *Type) !usize { if (!try cbor.matchValue(&iter, cbor.extract_cbor(&cbor_item))) return error.BadCompletion; const values = get_values(cbor_item); - if (existing.contains(values.sort_text)) continue; - try existing.put(self.allocator, values.sort_text, {}); + const dup_text = if (values.sort_text.len > 0) values.sort_text else values.label; + if (existing.contains(dup_text)) continue; + try existing.put(self.allocator, dup_text, {}); if (self.value.replace == null) if (get_replace_selection(values.replace)) |replace| { self.value.replace = replace;