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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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
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 ~
1 participant