Skip to content
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

Merged
merged 3 commits into from
Jul 22, 2022
Merged

jumplist picker #3033

merged 3 commits into from
Jul 22, 2022

Conversation

QiBaobin
Copy link
Contributor

@QiBaobin QiBaobin commented Jul 11, 2022

Fixes #2664

Copy link
Member

@CBenoit CBenoit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

helix-view/src/view.rs Outdated Show resolved Hide resolved
helix-term/src/commands.rs Outdated Show resolved Hide resolved
.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,
Copy link
Member

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.

Copy link
Contributor Author

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

Copy link

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.

QiBaobin and others added 2 commits July 18, 2022 19:34
Co-authored-by: Benoît Cortier <bcortier@proton.me>
Co-authored-by: Benoît Cortier <bcortier@proton.me>
@archseer archseer merged commit 2f53644 into helix-editor:master Jul 22, 2022
thomasskk pushed a commit to thomasskk/helix that referenced this pull request Sep 9, 2022
* jumplist picker

* remove jumps slicing

Co-authored-by: Benoît Cortier <bcortier@proton.me>

* remove unnecessary deref format! parameter

Co-authored-by: Benoît Cortier <bcortier@proton.me>

Co-authored-by: Benoît Cortier <bcortier@proton.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Add a picker for the jumplist
4 participants