-
-
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
Improve goto_file_impl
#9065
Improve goto_file_impl
#9065
Conversation
5b05bbb
to
eab5cbd
Compare
may I ask if you can try it out? |
shellexpand
and extend surround_chars
goto_file_impl
File path detection strategyI decided to read the chars next to the cursor one by one because:
Other informationSo I tested it on |
I'd consider adding |
added |
helix-term/src/commands.rs
Outdated
&[ | ||
'@', '/', '\\', '.', '-', '_', '+', '#', '$', '%', '{', '}', '[', ']', ':', | ||
'!', '~', '=', | ||
] | ||
} else { | ||
&['@', '/', '.', '-', '_', '+', '#', '$', '%', '~', '='] | ||
}; | ||
valid_chars.contains(c) || c.is_alphabetic() |
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.
I looked that up from neovim
. See :h isf
in neovim
for the list of chars.
43c7816
to
c5c4c3e
Compare
I can't execute the integration tests. Executing
|
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.
Thanks!
.count(); | ||
|
||
let path: Cow<str> = text | ||
.slice((start_pos - prefix_len)..(start_pos + postfix_len)) |
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.
For readers' context: rope slicing is by character index rather than byte index (like &str
) which is why this uses chars_at(..).count()
rather than a len of a substring
continues #9038
Closes #8822 #8824