mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
Add the / directory to suggestions in cd --interactive
To be able to jump directly to `/` via `g SPACE`
This commit is contained in:
parent
70e459a011
commit
0f56ba88f3
1 changed files with 6 additions and 0 deletions
|
|
@ -50,6 +50,12 @@ impl Cmp {
|
|||
}
|
||||
}
|
||||
|
||||
// "/" is both a directory separator and the root directory per se
|
||||
// As there's no parent directory for the FS root, it is a special case
|
||||
if parent.as_path() == std::path::Path::new("/") {
|
||||
cache.push(CmpItem { name: "".into(), is_dir: true });
|
||||
}
|
||||
|
||||
if !cache.is_empty() {
|
||||
cache.sort_unstable_by(|a, b| {
|
||||
natsort(a.name.as_encoded_bytes(), b.name.as_encoded_bytes(), false)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue