aboutsummaryrefslogtreecommitdiffstats
path: root/atuin-client/src/settings.rs
diff options
context:
space:
mode:
authorConrad Ludgate <conradludgate@gmail.com>2023-03-26 15:47:38 +0100
committerGitHub <noreply@github.com>2023-03-26 15:47:38 +0100
commitbb7f00dbef3bf4c7c00c1969cb0089de51bd9ba9 (patch)
tree6ac9722a353f844c2896335d2617eb49a677b20f /atuin-client/src/settings.rs
parentUpdate README.md (diff)
downloadatuin-bb7f00dbef3bf4c7c00c1969cb0089de51bd9ba9.zip
chore: use fork of skim (#803)
* use fuzzy-matcher instead of skim switch to a search-engine abstraction * fmt * fix deprecated warnings
Diffstat (limited to 'atuin-client/src/settings.rs')
-rw-r--r--atuin-client/src/settings.rs15
1 files changed, 5 insertions, 10 deletions
diff --git a/atuin-client/src/settings.rs b/atuin-client/src/settings.rs
index a2d4f8c5..756c4966 100644
--- a/atuin-client/src/settings.rs
+++ b/atuin-client/src/settings.rs
@@ -46,16 +46,11 @@ impl SearchMode {
pub fn next(&self, settings: &Settings) -> Self {
match self {
SearchMode::Prefix => SearchMode::FullText,
- SearchMode::FullText => {
- // if the user is using skim, we go to skim, otherwise fuzzy.
- if settings.search_mode == SearchMode::Skim {
- SearchMode::Skim
- } else {
- SearchMode::Fuzzy
- }
- }
- SearchMode::Fuzzy => SearchMode::Prefix,
- SearchMode::Skim => SearchMode::Prefix,
+ // if the user is using skim, we go to skim
+ SearchMode::FullText if settings.search_mode == SearchMode::Skim => SearchMode::Skim,
+ // otherwise fuzzy.
+ SearchMode::FullText => SearchMode::Fuzzy,
+ SearchMode::Fuzzy | SearchMode::Skim => SearchMode::Prefix,
}
}
}