diff --git a/yazi-config/preset/yazi.toml b/yazi-config/preset/yazi.toml index bb91c0ce..05a60fa2 100644 --- a/yazi-config/preset/yazi.toml +++ b/yazi-config/preset/yazi.toml @@ -139,7 +139,7 @@ cd_origin = "top-center" cd_offset = [ 0, 2, 50, 3 ] # create -create_title = "Create:" +create_title = [ "Create:", "Create (dir):" ] create_origin = "top-center" create_offset = [ 0, 2, 50, 3 ] diff --git a/yazi-config/src/popup/input.rs b/yazi-config/src/popup/input.rs index 633066b1..50670a51 100644 --- a/yazi-config/src/popup/input.rs +++ b/yazi-config/src/popup/input.rs @@ -14,7 +14,7 @@ pub struct Input { pub cd_offset: Offset, // create - pub create_title: String, + pub create_title: [String; 2], pub create_origin: Origin, pub create_offset: Offset, diff --git a/yazi-config/src/popup/options.rs b/yazi-config/src/popup/options.rs index dc669b5b..42ebe423 100644 --- a/yazi-config/src/popup/options.rs +++ b/yazi-config/src/popup/options.rs @@ -40,9 +40,9 @@ impl InputCfg { } } - pub fn create() -> Self { + pub fn create(dir: bool) -> Self { Self { - title: INPUT.create_title.to_owned(), + title: INPUT.create_title[dir as usize].to_owned(), position: Position::new(INPUT.create_origin, INPUT.create_offset), ..Default::default() } diff --git a/yazi-core/src/manager/commands/create.rs b/yazi-core/src/manager/commands/create.rs index 8cca95e9..6e4ade2a 100644 --- a/yazi-core/src/manager/commands/create.rs +++ b/yazi-core/src/manager/commands/create.rs @@ -22,7 +22,7 @@ impl Manager { let opt = opt.into() as Opt; let cwd = self.cwd().to_owned(); tokio::spawn(async move { - let mut result = InputProxy::show(InputCfg::create()); + let mut result = InputProxy::show(InputCfg::create(opt.dir)); let Some(Ok(name)) = result.recv().await else { return Ok(()); };