From 980942260db38b5fb6b750aa7a2cc799cf389d3f Mon Sep 17 00:00:00 2001 From: aserowy Date: Sat, 6 Jan 2024 15:11:05 +0100 Subject: [PATCH] fixed file opener without flags Signed-off-by: aserowy --- yazi-core/src/manager/commands/open.rs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/yazi-core/src/manager/commands/open.rs b/yazi-core/src/manager/commands/open.rs index 22c25d53..9268338e 100644 --- a/yazi-core/src/manager/commands/open.rs +++ b/yazi-core/src/manager/commands/open.rs @@ -102,7 +102,6 @@ impl Manager { fn quit_with_chooser(selected: &[&File]) -> bool { let mut quit_actions = vec![QuitAction::CwdToFile]; - let mut initiated_quit = false; let paths = selected.iter().fold(OsString::new(), |mut s, &f| { s.push(f.url.as_os_str()); @@ -112,18 +111,20 @@ impl Manager { if ARGS.chooser_file.is_some() { quit_actions.push(QuitAction::SelectToFile(paths.clone())); - initiated_quit = true; }; if ARGS.chooser_stdout { quit_actions.push(QuitAction::SelectToStdout(paths.clone())); - initiated_quit = true; }; - tokio::spawn(async move { - emit!(Quit(quit_actions)); - }); + if quit_actions.len() > 1 { + tokio::spawn(async move { + emit!(Quit(quit_actions)); + }); - initiated_quit + true + } else { + false + } } }