From aeb43fe00c21a304a6c2e709f73f4f83ecf80000 Mon Sep 17 00:00:00 2001 From: rolv Date: Sun, 4 Feb 2024 15:22:49 +0000 Subject: [PATCH] fix: don't search with an empty string --- yazi-core/src/tab/commands/search.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/yazi-core/src/tab/commands/search.rs b/yazi-core/src/tab/commands/search.rs index ae8c4640..22a5d9fa 100644 --- a/yazi-core/src/tab/commands/search.rs +++ b/yazi-core/src/tab/commands/search.rs @@ -63,6 +63,10 @@ impl Tab { let mut input = Input::_show(InputCfg::search(&opt.type_.to_string())); let Some(Ok(subject)) = input.recv().await else { bail!("") }; + if subject.is_empty() { + return Ok(()); + } + cwd = cwd.into_search(subject.clone()); let rx = if opt.type_ == OptType::Rg { external::rg(external::RgOpt { cwd: cwd.clone(), hidden, subject })