Skip to content

vi: skip trailing whitespace after e/E word-end motion - #5496

Open
MsfPablo wants to merge 1 commit into
tmux:masterfrom
MsfPablo:fix/vi-copy-mode-e-word-end
Open

vi: skip trailing whitespace after e/E word-end motion#5496
MsfPablo wants to merge 1 commit into
tmux:masterfrom
MsfPablo:fix/vi-copy-mode-e-word-end

Conversation

@MsfPablo

Copy link
Copy Markdown

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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Not Started

Development

Successfully merging this pull request may close these issues.

e and E motions in vi copy mode do not cross line boundaries

1 participant