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 tilde for selected paths in goto_file #10964

Merged
merged 1 commit into from
Jul 10, 2024
Merged

Conversation

the-mikedavis
Copy link
Member

Previously gf on ~/.config/helix for example would error if the entire path was selected but succeed and open a picker for the directory contents if the selection was one one-width cursor. We need to expand tildes for all paths instead of just the auto-detected paths.

This also refactors the goto_file blocks a little so that we construct paths once instead of creating the Vec and immediately clearing it when the selection is one single-width cursor.

Fixes #10948

Previously `gf` on `~/.config/helix` for example would error if the
entire path was selected but succeed and open a picker for the directory
contents if the selection was one one-width cursor. We need to expand
tildes for all paths instead of just the auto-detected paths.

This also refactors the `goto_file` blocks a little so that we construct
`paths` once instead of creating the Vec and immediately clearing it
when the selection is one single-width cursor.
@the-mikedavis the-mikedavis added C-bug Category: This is a bug A-command Area: Commands labels Jun 14, 2024
Copy link
Contributor

@matta matta left a comment

Choose a reason for hiding this comment

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

Just a drive by comment, take it or leave it. ;-)

helix-term/src/commands.rs Show resolved Hide resolved
@archseer archseer merged commit 15a26b8 into master Jul 10, 2024
6 checks passed
@archseer archseer deleted the goto_file-expand_tilde branch July 10, 2024 03:40
smortime pushed a commit to smortime/helix that referenced this pull request Jul 10, 2024
Previously `gf` on `~/.config/helix` for example would error if the
entire path was selected but succeed and open a picker for the directory
contents if the selection was one one-width cursor. We need to expand
tildes for all paths instead of just the auto-detected paths.

This also refactors the `goto_file` blocks a little so that we construct
`paths` once instead of creating the Vec and immediately clearing it
when the selection is one single-width cursor.
mxxntype pushed a commit to mxxntype/helix that referenced this pull request Aug 14, 2024
Previously `gf` on `~/.config/helix` for example would error if the
entire path was selected but succeed and open a picker for the directory
contents if the selection was one one-width cursor. We need to expand
tildes for all paths instead of just the auto-detected paths.

This also refactors the `goto_file` blocks a little so that we construct
`paths` once instead of creating the Vec and immediately clearing it
when the selection is one single-width cursor.
kyruzic pushed a commit to kyruzic/helix that referenced this pull request Sep 27, 2024
Previously `gf` on `~/.config/helix` for example would error if the
entire path was selected but succeed and open a picker for the directory
contents if the selection was one one-width cursor. We need to expand
tildes for all paths instead of just the auto-detected paths.

This also refactors the `goto_file` blocks a little so that we construct
`paths` once instead of creating the Vec and immediately clearing it
when the selection is one single-width cursor.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-command Area: Commands C-bug Category: This is a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gf can't open directories that start with ~
3 participants