vi: skip trailing whitespace after e/E word-end motion - #5496
Open
MsfPablo wants to merge 1 commit into
Open
Conversation
grid_reader_cursor_next_word_end exited via 'return' from the inner do/while loops, mirroring an early draft of grid_reader_cursor_next_word. Its sibling grid_reader_cursor_next_word breaks out of the inner loops and then runs a trailing whitespace-skip loop; this function should match that pattern. Without the trailing skip, e/E in vi copy-mode land on the first character of the next word rather than on the last character of the current one whenever the next word is on a fresh, wrapping line. Fall through from the inner branches with 'break' instead of 'return', preserve the outer wrap guard, and add the trailing WHITESPACE-skip loop. Declare 'width' locally for the skip loop. AI-assisted: implementation, commit message, and PR text prepared with AI assistance.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #5491.
grid_reader_cursor_next_word_end 'return's from the inner
do/while loops without continuing the outer wrap loop. Its sibling
grid_reader_cursor_next_word breaks out of the inner loops and then
runs a trailing WHITESPACE-skip loop; this function should match that
pattern. Without the trailing skip, e/E in vi copy-mode land on the
first character of the next word rather than on the last character of
the current one whenever the next word is on a fresh, wrapping line.
Fall through from the inner branches with 'break' instead of 'return',
preserve the outer wrap guard, and add the trailing WHITESPACE-skip
loop. Declare 'width' locally for the skip loop.
AI-assisted: implementation, commit message, and PR text prepared with AI assistance.