mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
feat: better handling of kill path separator
This commit is contained in:
parent
df42ca799e
commit
74ba02a61b
1 changed files with 6 additions and 2 deletions
|
|
@ -62,8 +62,12 @@ impl Input {
|
|||
input.take_while(|&c| CharKind::new(c) == first).count() + 1
|
||||
}
|
||||
|
||||
let spaces = count_spaces(input.clone());
|
||||
spaces + count_characters(input.skip(spaces))
|
||||
let space_or_trailing_slash = match input.clone().next() {
|
||||
Some(std::path::MAIN_SEPARATOR) => 1,
|
||||
Some(c) if CharKind::new(c) == CharKind::Space => count_spaces(input.clone()),
|
||||
_ => 0,
|
||||
};
|
||||
space_or_trailing_slash + count_characters(input.skip(space_or_trailing_slash))
|
||||
}
|
||||
|
||||
pub fn kill<'a>(&mut self, opt: impl Into<Opt<'a>>) -> bool {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue