From 5da0579864a13b11bf0808f7f69f7b22f18054b1 Mon Sep 17 00:00:00 2001 From: Phil Jones Date: Sat, 19 Nov 2022 19:28:52 +0000 Subject: Fix sorting in normal tofi mode with history. By using a hash table rather than binary search to find existing items, we can avoid the need to sort the input. --- src/main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 448c164..9d9f4d9 100644 --- a/src/main.c +++ b/src/main.c @@ -1351,9 +1351,8 @@ int main(int argc, char *argv[]) if (tofi.history_file[0] == 0) { tofi.use_history = false; } else { - string_vec_sort(&tofi.window.entry.commands); tofi.window.entry.history = history_load(tofi.history_file); - compgen_history_sort(&tofi.window.entry.commands, &tofi.window.entry.history); + string_vec_history_sort(&tofi.window.entry.commands, &tofi.window.entry.history); } } } -- cgit v1.2.3