mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
fix: make cd expand variables regardless
This commit is contained in:
parent
4026cebd88
commit
ab04ce5d77
1 changed files with 10 additions and 6 deletions
|
|
@ -17,17 +17,21 @@ struct Opt {
|
||||||
|
|
||||||
impl From<Cmd> for Opt {
|
impl From<Cmd> for Opt {
|
||||||
fn from(mut c: Cmd) -> Self {
|
fn from(mut c: Cmd) -> Self {
|
||||||
let mut target = c.take_first().and_then(Data::into_url).unwrap_or_default();
|
Self {
|
||||||
|
interactive: c.bool("interactive"),
|
||||||
|
..Self::from(c.take_first().and_then(Data::into_url).unwrap_or_default())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<Url> for Opt {
|
||||||
|
fn from(mut target: Url) -> Self {
|
||||||
if target.is_regular() {
|
if target.is_regular() {
|
||||||
target = Url::from(expand_path(&target));
|
target = Url::from(expand_path(&target));
|
||||||
}
|
}
|
||||||
|
Self { target, interactive: false }
|
||||||
Self { target, interactive: c.bool("interactive") }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
impl From<Url> for Opt {
|
|
||||||
fn from(target: Url) -> Self { Self { target, interactive: false } }
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Tab {
|
impl Tab {
|
||||||
#[yazi_codegen::command]
|
#[yazi_codegen::command]
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue