-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
jumplist picker #3033
jumplist picker #3033
Conversation
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.
Nice!
.map(helix_core::path::get_relative_path); | ||
let path = match path.as_deref().and_then(Path::to_str) { | ||
Some(path) => path, | ||
None => SCRATCH_BUFFER_NAME, |
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.
I’m not sure [scratch]
is a good fallback if path is (partially) not valid UTF-8. Did you consider to_string_lossy instead? This does not incur allocation when data is entirely valid UTF-8.
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.
Thanks for the view, Learned from your suggestions. Regarding this comment, I copied the logic from buffer picker, I am not sure if we shall use to_string_lossy, I think we can change it in both places if this is better.
CC: @cossonleo , @the-mikedavis
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.
I think that for the buffer it makes perfect sense to fall-back to [scratch] whereas here it seems an alternative is needed, of which to_string_lossy is one of.
Co-authored-by: Benoît Cortier <[email protected]>
Co-authored-by: Benoît Cortier <[email protected]>
* jumplist picker * remove jumps slicing Co-authored-by: Benoît Cortier <[email protected]> * remove unnecessary deref format! parameter Co-authored-by: Benoît Cortier <[email protected]> Co-authored-by: Benoît Cortier <[email protected]>
Fixes #2664