-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Feat/extend goto file #9038
Feat/extend goto file #9038
Conversation
3475b5b
to
a20a359
Compare
helix-term/tests/test/commands.rs
Outdated
// path ends with "," | ||
test_key_sequence( | ||
&mut AppBuilder::new().with_file(file.path(), None).build()?, | ||
Some("i/tmp/test.txt,<esc>bgf"), |
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.
This test seems a bit strange, the cursor is on the ,
when triggering gf
, meaning a character that is excluded from the output path.
On non selection This would require to split the non-path characters in “terminates if neighboring whitespace”, e.g., One thing one might consider, is using treesitter if available, this would allow actual string support, and could even support spaces. This is probably more of a future extension of this, as it would only work when treesitter is supported for the file at hand. |
Hm... good point, I'll try to make use of tree-sitter here |
You can see how tree-sitter is used for matching brackets as a stepping stone: helix/helix-core/src/match_brackets.rs Lines 54 to 128 in 5109286
|
2e87747
to
5109286
Compare
Github will automatically close PRs if it doesn't see any difference between the PR's branch and the target branch. It looks like you force-pushed the branch to 5109286 which is a commit from master |
oooh ok, thank you for the information! |
Closes #8822 #8824
I'm unsure how to write a test with:
~
Also executing
gf
with:will interpret it as
some/path".to_string
. The only solution which I can think of, is manually collecting all "valid" characters on the right and on the left of the cursor, should I do it like that?I also added a new config-option:
goto_file_ignore_unknown_env_var
.The reason is, that I'm unsure how to let
helix
behave, if the env-var like$FOO
isn't set, but helix should go to the file$FOO/yay.txt
. Should it just throw an error and don't enter the file or should it still enter the file? That's what the option provides: Saying that it should treat the path as a normal path, if an env-variable isn't set.But tbh. I'm unsure if this config-option is needed, so feel free to say, that I should remove it.