fix(1220): Workspace Filtermode not handled in skim engine (#1273)

* fix(1220): Workspace Filtermode not handled in skim engine

* fix: review suggestion accepted
This commit is contained in:
Dieter Eickstaedt 2023-10-05 17:54:54 +02:00 committed by GitHub
parent f25681d8b1
commit 1735be05d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -54,6 +54,11 @@ async fn fuzzy_search(
yield_now().await; yield_now().await;
} }
let context = &state.context; 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 { match state.filter_mode {
FilterMode::Global => {} FilterMode::Global => {}
// we aggregate host by ',' separating them // we aggregate host by ',' separating them
@ -72,6 +77,7 @@ async fn fuzzy_search(
.contains(&context.session.as_bytes()) => {} .contains(&context.session.as_bytes()) => {}
// we aggregate directory by ':' separating them // we aggregate directory by ':' separating them
FilterMode::Directory if history.cwd.split(':').contains(&context.cwd.as_str()) => {} FilterMode::Directory if history.cwd.split(':').contains(&context.cwd.as_str()) => {}
FilterMode::Workspace if history.cwd.split(':').contains(&git_root) => {}
_ => continue, _ => continue,
} }
#[allow(clippy::cast_lossless, clippy::cast_precision_loss)] #[allow(clippy::cast_lossless, clippy::cast_precision_loss)]