From 38e681f7bf5c2c407bf3e3e0239d8d6ce052af57 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Thu, 29 Jan 2026 16:01:20 +0100 Subject: [PATCH] fix: apply completion de-duplication fix to completion_palette too --- src/tui/mode/overlay/completion_palette.zig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tui/mode/overlay/completion_palette.zig b/src/tui/mode/overlay/completion_palette.zig index bf23235..194112c 100644 --- a/src/tui/mode/overlay/completion_palette.zig +++ b/src/tui/mode/overlay/completion_palette.zig @@ -49,8 +49,9 @@ pub fn load_entries(palette: *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(palette.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(palette.allocator, dup_text, {}); if (palette.value.replace == null) if (get_replace_selection(values.replace)) |replace| { palette.value.replace = replace;