mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
feat: change input title when using create --dir
This commit is contained in:
parent
28083d805e
commit
680da00d97
4 changed files with 5 additions and 5 deletions
|
|
@ -139,7 +139,7 @@ cd_origin = "top-center"
|
||||||
cd_offset = [ 0, 2, 50, 3 ]
|
cd_offset = [ 0, 2, 50, 3 ]
|
||||||
|
|
||||||
# create
|
# create
|
||||||
create_title = "Create:"
|
create_title = [ "Create:", "Create (dir):" ]
|
||||||
create_origin = "top-center"
|
create_origin = "top-center"
|
||||||
create_offset = [ 0, 2, 50, 3 ]
|
create_offset = [ 0, 2, 50, 3 ]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ pub struct Input {
|
||||||
pub cd_offset: Offset,
|
pub cd_offset: Offset,
|
||||||
|
|
||||||
// create
|
// create
|
||||||
pub create_title: String,
|
pub create_title: [String; 2],
|
||||||
pub create_origin: Origin,
|
pub create_origin: Origin,
|
||||||
pub create_offset: Offset,
|
pub create_offset: Offset,
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,9 +40,9 @@ impl InputCfg {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn create() -> Self {
|
pub fn create(dir: bool) -> Self {
|
||||||
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),
|
position: Position::new(INPUT.create_origin, INPUT.create_offset),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ impl Manager {
|
||||||
let opt = opt.into() as Opt;
|
let opt = opt.into() as Opt;
|
||||||
let cwd = self.cwd().to_owned();
|
let cwd = self.cwd().to_owned();
|
||||||
tokio::spawn(async move {
|
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 {
|
let Some(Ok(name)) = result.recv().await else {
|
||||||
return Ok(());
|
return Ok(());
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue