-
-
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
Fix find commands for buffers with non-LF line-endings #8111
Conversation
4cc2c1d
to
7ad3c3c
Compare
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 think this is an ok fix (the implementation seems correct) but I think a better solution would be to special case this branch. And just use ropey to find the next line ending/start from the cursor (look at the implementation of gl/gh). That should be faster and correctly handle files with mixed line endings (resolving the TODO comment here)
17b55e0
to
557a34a
Compare
Done. Thank you for the suggestion. There are some edge cases thought. Comments explain them more clearly. |
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 looks very nice, some style nits but it seems like you covered all edgecases 👍
* Takes into account direction and an inclusive flag to select the first or last char of the line-ending string. * Adds tests to ensure `T` and `F` work with `\n` and `\r\n` line-endings.
f16a6c9
to
3aebade
Compare
Adds separate method for finding
<ret>
char.Closes #8057
Resolves TODO:
helix/helix-term/src/commands.rs
Lines 1270 to 1273 in 79c0425