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

Expand ~ when parsing file paths in :open #5329

Merged

Conversation

iobtl
Copy link
Contributor

@iobtl iobtl commented Dec 28, 2022

Addresses #5322.

Expected

  • :open should work on directories with ~ in the filepath (i.e. file picker dialog opens)
helix1fix.mov

@kirawi kirawi added A-helix-term Area: Helix term improvements S-waiting-on-review Status: Awaiting review from a maintainer. labels Dec 28, 2022
let def = || (PathBuf::from(s), Position::default());
let def = || {
(
helix_core::path::expand_tilde(Path::new(s)),
Copy link
Member

Choose a reason for hiding this comment

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

I think it would be better to call this from open in helix-term/src/commands/typed.rs. We don't need to do this for files passed in the argv since the shell will do the tilde expansion and there's a small bug here where :open fails if you give it a directory that has a tilde and a row or row/col position (though that isn't a use-case that makes sense)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, makes sense 👍

@iobtl iobtl requested a review from the-mikedavis December 29, 2022 16:01
@the-mikedavis the-mikedavis linked an issue Dec 29, 2022 that may be closed by this pull request
@the-mikedavis the-mikedavis changed the title args: expand ~ when parsing file paths Expand ~ when parsing file paths in :open Dec 29, 2022
@the-mikedavis the-mikedavis merged commit 6c95411 into helix-editor:master Dec 29, 2022
mejo13 pushed a commit to mejo13/helix that referenced this pull request Dec 29, 2022
semin-park pushed a commit to semin-park/helix that referenced this pull request Jan 4, 2023
hadronized pushed a commit to hadronized/helix that referenced this pull request Jan 4, 2023
freqmod pushed a commit to freqmod/helix that referenced this pull request Feb 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements S-waiting-on-review Status: Awaiting review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

:open doesn't expand "~" to home directory
3 participants