config: add --no-sort
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Daniel Eklöf · committed by Daniel Eklöf · parent 8d77e69 · Browse files · 9 files·+39 added−3 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
9 files+39 added−3 removed
- other:+39 added−3 removed
Provenance
- Commit
d9e817a- Tree
3c527a9- Author
Daniel Eklöf <daniel@ekloef.se>- Committer
Daniel Eklöf <daniel@ekloef.se>- Parent
8d77e69
9 files changed+39 added−3 removed
modified:completions/fish/fuzzel.fish+1 added
46 unmodified lines47 complete -c fuzzel -x -s r -l border-radius -d "amount of corner \"roundness\" (10)"48 complete -c fuzzel -x -s C -l border-color -d "border color (002b36ff)"49 complete -c fuzzel -l show-actions -d "include desktop actions (e.g. \"New Window\") in the list"50 complete -c fuzzel -x -l match-mode -a "exact fzf fuzzy" -d "how to match what you type against the entries"51+complete -c fuzzel -l no-sort -d "do not sort the result"52 complete -c fuzzel -l filter-desktop -d "filter desktop entries based on XDG_CURRENT_DESKTOP"53 complete -c fuzzel -l list-executables-in-path -d "filter desktop entries based on XDG_CURRENT_DESKTOP"54 complete -c fuzzel -x -l fuzzy-min-length -d "list executables present in the path environment variable"55 complete -c fuzzel -x -l fuzzy-max-length-discrepancy -d "maximum allowed length difference between the search string and a fuzzy match (2)"17 unmodified linesmodified:completions/zsh/_fuzzel+1 added
38 unmodified lines39 '(-r --border-radius)'{-r,--border-radius}'[amount of corner "roundness" (10)]:border-radius:()' \40 '(-C --border-color)'{-C,--border-color}'[border color (002b36ff)]:border-color:()' \41 '--show-actions[include desktop actions (e.g "New Window") in the list]' \42 '--match-mode[how to match what you type against the entries (fzf)]:match_mode:(exact fzf fuzzy)' \43+ '--no-sort[do not sort the result]' \44 '--filter-desktop=-[filter desktop entries based on XDG_CURRENT_DESKTOP]: :(no)' \45 '--list-executables-in-path[list executables present in the PATH environment variable]'\46 '--fuzzy-min-length[search strings shorter than this will not be fuzzy matched (3)]:()' \47 '--fuzzy-max-length-discrepancy[maximum allowed length difference between the search string and a fuzzy match (2)]:()' \35 unmodified linesmodified:doc/fuzzel.1.scd+4 added
234 unmodified lines235 Include desktop actions in the list. Desktop actions are236 alternative actions some desktop entries have. Examples include237 "New Window", "New Document", etc.238 239+*--no-sort*240+ Do not sort the result.241+242 *--filter-desktop*=[_no_]243 Filter the visible desktop entries based on the value of244 XDG_CURRENT_DESKTOP. If the optional parameter is "no",245 explicitly disables filtering.76 unmodified lines322 *--delayed-filter-limit*=_N_323 When there are more matches than this, switch from immediate324 refiltering to delayed refiltering (see325 *--delayed-filter-ms*). Default: _20000_.326+327 *-d*,*--dmenu*328 dmenu compatibility mode. In this mode, the list entries are read329 from stdin (newline separated). The selected entry is printed to330 stdout. If the input string does not match any of the entries, the90 unmodified linesmodified:doc/fuzzel.ini.5.scd+15 added-3 removed
133 unmodified lines134 *--password*. Note that this can be overridden on the command135 line, by explicitly specifying the character with136 *--password=X*. Default: _\*_.137 138-*filter-desktop*139- Boolean. Filter desktop files based on the value of XDG_CURRENT_DESKTOP.140-138 *match-mode*139 One of *exact*, *fzf* and *fuzzy*.140 141 *exact*: what you type is matched exactly against each field in6 unmodified lines148 against each field in the *fields* list.149 150 Default: _fzf_151 152+*sort-result*153+ Boolean. Whether to sort the result or not. Disabling sorting154+ means no comparisons will be made between match155+ results. I.e. launch count, match length, etc will be156+ ignored. This effectively disables the cache (though, the cache is157+ still updated on exit).158+159+ This can improve search latency when searching very large data160+ sets.161+ 162+ Default: _yes_163+164+*filter-desktop*165+ Boolean. Filter desktop files based on the value of XDG_CURRENT_DESKTOP.166+167 *show-actions*168 Boolean. Some desktop files define "actions", in addition to the169 application itself. Examples are "new window", "preferences",170 etc. When this option is enabled, those actions will be listed by337 unmodified linesmodified:CHANGELOG.md+2 added
72 unmodified lines73 * The currently selected entry may now be rendered with a bold74 font. It is disabled by default, and can be enabled either via the75 new `--use-bold` command line option, or by setting `use-bold=yes`,76 in `fuzzel.ini`.77+* `sort-result` option to `fuzzel.ini`, and `--no-sort` command line78+ option.79 80 [344]: https://codeberg.org/dnkl/fuzzel/issues/34481 [131]: https://codeberg.org/dnkl/fuzzel/issues/13182 [189]: https://codeberg.org/dnkl/fuzzel/issues/189700 unmodified linesmodified:config.c+4 added
895 unmodified lines896 (const char *[]){"exact", "fzf", "fuzzy", NULL},897 (int *)&conf->match_mode);898 }899 900+ else if (strcmp(key, "sort-result") == 0)901+ return value_to_bool(ctx, &conf->sort_result);902+903 else if (strcmp(key, "delayed-filter-ms") == 0)904 return value_to_uint32(ctx, 10, &conf->delayed_filter_ms);905 906 else if (strcmp(key, "delayed-filter-limit") == 0)690 unmodified lines1597 .icons_enabled = true,1598 .icon_theme = strdup("hicolor"),1599 .actions_enabled = false,1600 .match_mode = MATCH_MODE_FZF,1601+ .sort_result = true,1602 .delayed_filter_ms = 300,1603 .delayed_filter_limit = 20000,1604 .fuzzy = {1605 .min_length = 3,124 unmodified linesmodified:config.h+1 added
127 unmodified lines128 129 struct config_key_binding_list key_bindings;130 131 enum match_mode match_mode;132+ bool sort_result;133 134 uint32_t delayed_filter_ms;135 uint32_t delayed_filter_limit;136 67 unmodified linesmodified:fuzzel.ini+1 added
7 unmodified lines8 # fields=filename,name,generic9 # password-character=*10 # filter-desktop=no11 # match-mode=fzf12+# sort-result=yes13 # delayed-filter-ms=30014 # delayed-filter-limit=2000015 # show-actions=no16 # terminal=$TERMINAL -e # Note: you cannot actually use environment variables here92 unmodified linesmodified:main.c+10 added
377 unmodified lines378 " --launch-prefix=COMMAND prefix to add before argv of executed program\n"379 " --list-executables-in-path include executables from PATH in the list\n"380 " --render-workers=N number of threads to use for rendering\n"381 " --match-workers=N number of threads to use for matching\n"382+ " --no-sort do not sort the result\n"383 " --delayed-filter-ms=TIME_MS time in ms before refiltering after a keystroke\n"384 " (300)\n"385 " --delayed-filter-limit=N used delayed refiltering when the number of\n"386 " matches exceeds this number (10000)\n"314 unmodified lines701 #define OPT_PROMPT_ONLY 284702 #define OPT_COUNT_COLOR 285703 #define OPT_USE_BOLD 286704 #define OPT_MATCH_WORKERS 287705+ #define OPT_NO_SORT 288706 #define OPT_DELAYED_FILTER_MS 289707 #define OPT_DELAYED_FILTER_LIMIT 290708 709 static const struct option longopts[] = {118 unmodified lines828 bool render_workers_set:1;829 bool match_workers_set:1;830 bool prompt_only_set:1;831 bool use_bold_set:1;832+ bool no_sort_set:1;833 bool delayed_filter_ms_set:1;834 bool delayed_filter_limit_set:1;835 } cmdline_overrides = {{0}};836 658 unmodified lines1495 1496 cmdline_overrides.match_workers_set = true;1497 break;1498 1499+ case OPT_NO_SORT:1500+ cmdline_overrides.conf.sort_result = false;1501+ cmdline_overrides.no_sort_set = true;1502+ break;1503+1504 case OPT_DELAYED_FILTER_MS:1505 if (sscanf(optarg, "%u", &cmdline_overrides.conf.delayed_filter_ms) != 1) {1506 fprintf(stderr, "%s: invalid delayed-filter-ms (must be an integer)\n",1507 optarg);165 unmodified lines1673 if (cmdline_overrides.render_workers_set)1674 conf.render_worker_count = cmdline_overrides.conf.render_worker_count;1675 if (cmdline_overrides.match_workers_set)1676 conf.match_worker_count = cmdline_overrides.conf.match_worker_count;1677+ if (cmdline_overrides.no_sort_set)1678+ conf.sort_result = cmdline_overrides.conf.sort_result;1679 if (cmdline_overrides.delayed_filter_ms_set)1680 conf.delayed_filter_ms = cmdline_overrides.conf.delayed_filter_ms;1681 if (cmdline_overrides.delayed_filter_limit_set)1682 conf.delayed_filter_limit = cmdline_overrides.conf.delayed_filter_limit;232 unmodified lines