Wrong cursor position after formatting with long 'formatprg'#18906
Closed
zeertzjq wants to merge 1 commit intovim:masterfrom
Closed
Wrong cursor position after formatting with long 'formatprg'#18906zeertzjq wants to merge 1 commit intovim:masterfrom
zeertzjq wants to merge 1 commit intovim:masterfrom
Conversation
04ed3aa to
73b1e84
Compare
Problem: Wrong cursor position after formatting with long 'formatprg'. Solution: Don't show hit-enter prompt when there are stuffed characters. Previously a stuffed character at the hit-enter prompt will dismiss the prompt immediately and be put in the typeahead buffer, which leads to incorrect behavior as the typeahead buffer is processed after the stuff buffers. Using vungetc() when KeyStuffed is TRUE can fix this problem, but since the hit-enter prompt isn't visible anyway (and is likely not desired here), just skip the prompt instead, which also avoids a wait when using "wait" instead of "hit-enter" in 'messagesopt'. fixes: vim#18905
73b1e84 to
60bb0b3
Compare
Member
|
thanks |
zeertzjq
added a commit
to zeertzjq/neovim
that referenced
this pull request
Dec 11, 2025
…'formatprg' Problem: Wrong cursor position after formatting with long 'formatprg'. Solution: Don't show hit-enter prompt when there are stuffed characters. Previously a stuffed character at the hit-enter prompt will dismiss the prompt immediately and be put in the typeahead buffer, which leads to incorrect behavior as the typeahead buffer is processed after the stuff buffers. Using vungetc() when KeyStuffed is TRUE can fix this problem, but since the hit-enter prompt isn't visible anyway (and is likely not desired here), just skip the prompt instead, which also avoids a wait when using "wait" instead of "hit-enter" in 'messagesopt'. fixes: vim/vim#18905 closes: vim/vim#18906 vim/vim@50325c3
zeertzjq
added a commit
to neovim/neovim
that referenced
this pull request
Dec 12, 2025
…'formatprg' (#36918) Problem: Wrong cursor position after formatting with long 'formatprg'. Solution: Don't show hit-enter prompt when there are stuffed characters. Previously a stuffed character at the hit-enter prompt will dismiss the prompt immediately and be put in the typeahead buffer, which leads to incorrect behavior as the typeahead buffer is processed after the stuff buffers. Using vungetc() when KeyStuffed is TRUE can fix this problem, but since the hit-enter prompt isn't visible anyway (and is likely not desired here), just skip the prompt instead, which also avoids a wait when using "wait" instead of "hit-enter" in 'messagesopt'. fixes: vim/vim#18905 closes: vim/vim#18906 vim/vim@50325c3
github-actions bot
pushed a commit
to neovim/neovim
that referenced
this pull request
Dec 12, 2025
…'formatprg' (#36918) Problem: Wrong cursor position after formatting with long 'formatprg'. Solution: Don't show hit-enter prompt when there are stuffed characters. Previously a stuffed character at the hit-enter prompt will dismiss the prompt immediately and be put in the typeahead buffer, which leads to incorrect behavior as the typeahead buffer is processed after the stuff buffers. Using vungetc() when KeyStuffed is TRUE can fix this problem, but since the hit-enter prompt isn't visible anyway (and is likely not desired here), just skip the prompt instead, which also avoids a wait when using "wait" instead of "hit-enter" in 'messagesopt'. fixes: vim/vim#18905 closes: vim/vim#18906 vim/vim@50325c3 (cherry picked from commit 18642a6)
github-actions bot
pushed a commit
to neovim/neovim
that referenced
this pull request
Dec 12, 2025
…'formatprg' (#36918) Problem: Wrong cursor position after formatting with long 'formatprg'. Solution: Don't show hit-enter prompt when there are stuffed characters. Previously a stuffed character at the hit-enter prompt will dismiss the prompt immediately and be put in the typeahead buffer, which leads to incorrect behavior as the typeahead buffer is processed after the stuff buffers. Using vungetc() when KeyStuffed is TRUE can fix this problem, but since the hit-enter prompt isn't visible anyway (and is likely not desired here), just skip the prompt instead, which also avoids a wait when using "wait" instead of "hit-enter" in 'messagesopt'. fixes: vim/vim#18905 closes: vim/vim#18906 vim/vim@50325c3 (cherry picked from commit 18642a6)
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.
Problem: Wrong cursor position after formatting with long 'formatprg'.
Solution: Don't show hit-enter prompt when there are stuffed characters.
Previously a stuffed character at the hit-enter prompt will dismiss the
prompt immediately and be put in the typeahead buffer, which leads to
incorrect behavior as the typeahead buffer is processed after the stuff
buffers. Using vungetc() when KeyStuffed is TRUE can fix this problem,
but since the hit-enter prompt isn't visible anyway (and is likely not
desired here), just skip the prompt instead, which also avoids a wait
when using "wait" instead of "hit-enter" in 'messagesopt'.
fixes: #18905