From 574eff0df1aff9bdc6d32939a03312cc08803de3 Mon Sep 17 00:00:00 2001 From: Phil Jones Date: Mon, 17 Apr 2023 23:43:05 +0100 Subject: Add --matching-algorithm option. This replaces the --fuzzy-match algorithm. Available choices are normal, prefix and fuzzy. Levenshtein distance was investigated, but it seems pretty rubbish for tofi's use case, where you normally want a good match when you've only typed a small portion of the target string. --- src/tofi.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/tofi.h') diff --git a/src/tofi.h b/src/tofi.h index 571eab8..048f9c9 100644 --- a/src/tofi.h +++ b/src/tofi.h @@ -8,6 +8,7 @@ #include "clipboard.h" #include "color.h" #include "entry.h" +#include "matching.h" #include "surface.h" #include "wlr-layer-shell-unstable-v1.h" #include "fractional-scale-v1.h" @@ -90,6 +91,7 @@ struct tofi { /* Options */ uint32_t anchor; + enum matching_algorithm matching_algorithm; bool ascii_input; bool hide_cursor; bool use_history; @@ -97,7 +99,6 @@ struct tofi { bool late_keyboard_init; bool drun_launch; bool drun_print_exec; - bool fuzzy_match; bool require_match; bool auto_accept_single; bool multiple_instance; -- cgit v1.2.3