Prevent cursor from reaching the last empty line #92
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an attempt at preventing the cursor from reaching the last empty line. The abroach is to do a simple test if the rule is violated and correct it. Another abroach is to go through upstream code and add checks whenever a violation is possible.
I don't think this is an important feature, so not sure if it's worth merging. However, currently,
search_selection_detect_word_boundaries
can panic on that line, which is solved in upstream.Note: I might be missing some cases of reaching the last-empty line (except for empty files). I have little experience with helix. Feel free to report if you find any.
Note: maybe a refactoring is needed to put all helix after/before command "hooks" under a test like
EvilCommands::is_enabled
.Edit: Avoiding the
search_selection_detect_word_boundaries
bug, would allow for */# multi-keyword search support in #79 . It's not a Vim feature but maybe evil-helix can aim to be a superset, when there's no conflict.