New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: better handling of killing path separator #385
Conversation
Can we add it behind a parameter like |
780c55c
to
117c14e
Compare
Sorry for the late update since I have a busy month. Now this behavior is controlled by the argument. |
Self { kind: e.args.first().map(|s| s.as_str()).unwrap_or_default() } | ||
Self { | ||
kind: e.args.first().map(|s| s.as_str()).unwrap_or_default(), | ||
mode: e.named.get("big-word").map_or(KillMode::Default, |_| KillMode::BigWord), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its better to impl the FromStr
(also Default
) trait for the KillMode
to do this.
spaces + count_characters(input.skip(spaces)) | ||
let space_or_trailing_slash = match input.clone().next() { | ||
Some(std::path::MAIN_SEPARATOR) if matches!(mode, KillMode::BigWord) => 1, | ||
Some(c) if CharKind::new(c) == CharKind::Space => count_spaces(input.clone()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that if CharKind::new(c) == CharKind::Space
is unnecessary.
85d99ce
to
4d8e276
Compare
51ea372
to
2febbee
Compare
I'm going to close this because it still needs some work and hasn't seen any activity recently. @XOR-op thanks for the effort! |
Better handling of killing trailing path separator.
Example: