mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-21 23:01: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 {
|
||||
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() {
|
||||
target = Url::from(expand_path(&target));
|
||||
}
|
||||
|
||||
Self { target, interactive: c.bool("interactive") }
|
||||
Self { target, interactive: false }
|
||||
}
|
||||
}
|
||||
impl From<Url> for Opt {
|
||||
fn from(target: Url) -> Self { Self { target, interactive: false } }
|
||||
}
|
||||
|
||||
impl Tab {
|
||||
#[yazi_codegen::command]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue