From 1735be05d71ec21ffb8648866fca83e210cfe31a Mon Sep 17 00:00:00 2001 From: Dieter Eickstaedt Date: Thu, 5 Oct 2023 17:54:54 +0200 Subject: [PATCH] fix(1220): Workspace Filtermode not handled in skim engine (#1273) * fix(1220): Workspace Filtermode not handled in skim engine * fix: review suggestion accepted --- atuin/src/command/client/search/engines/skim.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/atuin/src/command/client/search/engines/skim.rs b/atuin/src/command/client/search/engines/skim.rs index 06b717e4..e24eca7b 100644 --- a/atuin/src/command/client/search/engines/skim.rs +++ b/atuin/src/command/client/search/engines/skim.rs @@ -54,6 +54,11 @@ async fn fuzzy_search( yield_now().await; } let context = &state.context; + let git_root = context + .git_root + .as_ref() + .and_then(|git_root| git_root.to_str()) + .unwrap_or(&context.cwd); match state.filter_mode { FilterMode::Global => {} // we aggregate host by ',' separating them @@ -72,6 +77,7 @@ async fn fuzzy_search( .contains(&context.session.as_bytes()) => {} // we aggregate directory by ':' separating them FilterMode::Directory if history.cwd.split(':').contains(&context.cwd.as_str()) => {} + FilterMode::Workspace if history.cwd.split(':').contains(&git_root) => {} _ => continue, } #[allow(clippy::cast_lossless, clippy::cast_precision_loss)]