]> git.feebdaed.xyz Git - 0xmirror/vim.git/commit
patch 9.1.1969: Wrong cursor position after formatting with long 'formatprg'
authorzeertzjq <zeertzjq@outlook.com>
Thu, 11 Dec 2025 19:28:48 +0000 (20:28 +0100)
committerChristian Brabandt <cb@256bit.org>
Thu, 11 Dec 2025 19:28:48 +0000 (20:28 +0100)
commit50325c3d591806c57b04512dc103214acd0f2f18
tree84f5b67273f27b6b618b1f4c87c75730cec7caa5
parent44d480e0c3da6b83aaa289b70ecfd595ced9934b
patch 9.1.1969: Wrong cursor position after formatting with long '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:  #18905
closes: #18906

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/getchar.c
src/message.c
src/testdir/dumps/Test_long_formatprg_no_hit_enter_1.dump [new file with mode: 0644]
src/testdir/dumps/Test_long_formatprg_no_hit_enter_2.dump [new file with mode: 0644]
src/testdir/dumps/Test_long_formatprg_no_hit_enter_3.dump [new file with mode: 0644]
src/testdir/test_messages.vim
src/version.c