From cf9669976601697be36e21e3359709f09c31d9da Mon Sep 17 00:00:00 2001 From: Phil Jones Date: Wed, 27 Jul 2022 01:05:27 +0100 Subject: Fix drun mode when history is enabled. --- src/main.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main.c b/src/main.c index cb49c4a..03dc31e 100644 --- a/src/main.c +++ b/src/main.c @@ -1246,6 +1246,14 @@ int main(int argc, char *argv[]) uint32_t selection = tofi.window.entry.selection; char *res = tofi.window.entry.results.buf[selection].string; if (tofi.window.entry.drun) { + /* + * TODO: This is ugly. The list of apps + * needs to be sorted alphabetically + * for bsearch to find the selected + * entry, but we previously sorted by + * history count. This needs fixing. + */ + desktop_vec_sort(&tofi.window.entry.apps); struct desktop_entry *app = desktop_vec_find(&tofi.window.entry.apps, res); if (app == NULL) { log_error("Couldn't find application file! This shouldn't happen.\n"); -- cgit v1.2.3