summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Jones <philj56@gmail.com>2022-07-27 01:05:27 +0100
committerPhil Jones <philj56@gmail.com>2022-07-27 01:05:27 +0100
commitcf9669976601697be36e21e3359709f09c31d9da (patch)
treed816141fd992f762e1be854dbdcce623999cd281
parentbb80769bfdf2efcbf000bf838feaee0c1b31183d (diff)
Fix drun mode when history is enabled.
-rw-r--r--src/main.c8
1 files changed, 8 insertions, 0 deletions
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");