From: zeertzjq Date: Sat, 25 Jul 2026 16:46:29 +0000 (+0000) Subject: patch 9.2.0855: 'showcmd' not redrawn with empty mapping triggered on timeout X-Git-Tag: v9.2.0855^0 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=2e9687647a2ab2aadee00f01e37c71a5cffbdfcc;p=thirdparty%2Fvim.git patch 9.2.0855: 'showcmd' not redrawn with empty mapping triggered on timeout Problem: 'showcmd' not redrawn with empty mapping triggered on timeout. Solution: Don't postpone redraw when inside vgetorpeek(). Also move test for tabline 'showcmd' to test_tabline.vim. fixes: #20839 closes: #20840 Signed-off-by: zeertzjq Signed-off-by: Christian Brabandt --- diff --git a/src/normal.c b/src/normal.c index d5de6abe51..a7959d62f1 100644 --- a/src/normal.c +++ b/src/normal.c @@ -1850,14 +1850,14 @@ display_showcmd(void) if (*p_sloc == 's') { - if (showcmd_is_clear) + if (showcmd_is_clear && !vgetc_busy) curwin->w_redr_status = true; else win_redr_status(curwin, FALSE); } else if (*p_sloc == 't') { - if (showcmd_is_clear) + if (showcmd_is_clear && !vgetc_busy) redraw_tabline = TRUE; else draw_tabline(); diff --git a/src/testdir/test_statusline.vim b/src/testdir/test_statusline.vim index 69699a2d4d..6df015be1d 100644 --- a/src/testdir/test_statusline.vim +++ b/src/testdir/test_statusline.vim @@ -657,23 +657,6 @@ func Test_statusline_showcmd() call StopVimInTerminal(buf) endfunc -func Test_statusline_showcmd_redraw_tabline() - CheckRunVimInTerminal - - let lines =<< trim END - set showcmd showcmdloc=tabline showtabline=2 tabline=%S timeoutlen=0 - nnoremap g :redraw - nnoremap gc - END - call writefile(lines, 'XTest_statusline_showcmd_redraw', 'D') - - let buf = RunVimInTerminal('-S XTest_statusline_showcmd_redraw', #{rows: 6, cols: 40}) - call term_sendkeys(buf, 'g') - call WaitForAssert({-> assert_match(':redraw', term_getline(buf, 6))}) - call WaitForAssert({-> assert_notmatch('^:', term_getline(buf, 1))}) - call StopVimInTerminal(buf) -endfunc - func Test_statusline_showcmd_cmd_mapping() set showcmd set statusline=AAA%SBBB @@ -698,6 +681,25 @@ func Test_statusline_showcmd_cmd_mapping() endtry endfunc +func Test_statusline_showcmd_nop_map() + CheckRunVimInTerminal + + let lines =<< trim END + set timeoutlen=500 showcmdloc=statusline laststatus=2 + nnoremap + nnoremap + END + call writefile(lines, 'XTest_statusline_showcmd_nop', 'D') + + let buf = RunVimInTerminal('-S XTest_statusline_showcmd_nop', {'rows': 6}) + call term_sendkeys(buf, ' ') + call WaitForAssert({-> assert_match('<20>', term_getline(buf, 5))}, 400) + sleep 500m + call WaitForAssert({-> assert_notmatch('<20>', term_getline(buf, 5))}, 400) + + call StopVimInTerminal(buf) +endfunc + func Test_statusline_highlight_group_cleared() CheckScreendump diff --git a/src/testdir/test_tabline.vim b/src/testdir/test_tabline.vim index 7ae0602489..c2863554c4 100644 --- a/src/testdir/test_tabline.vim +++ b/src/testdir/test_tabline.vim @@ -213,6 +213,24 @@ func Test_tabline_showcmd() call StopVimInTerminal(buf) endfunc +func Test_tabline_showcmd_redraw_tabline() + CheckRunVimInTerminal + + let lines =<< trim END + set showcmd showcmdloc=tabline showtabline=2 tabline=%S timeoutlen=0 + nnoremap g :redraw + nnoremap gc + END + call writefile(lines, 'XTest_tabline_showcmd_redraw', 'D') + + let buf = RunVimInTerminal('-S XTest_tabline_showcmd_redraw', #{rows: 6, cols: 40}) + call term_sendkeys(buf, 'g') + call WaitForAssert({-> assert_match(':redraw', term_getline(buf, 6))}) + call WaitForAssert({-> assert_notmatch('^:', term_getline(buf, 1))}) + + call StopVimInTerminal(buf) +endfunc + func TruncTabLine() return '%1T口口%2Ta' .. repeat('b', &columns - 4) .. '%999X%#TabLine#c' endfunc diff --git a/src/version.c b/src/version.c index 4808dfa6d0..7a37a44ea2 100644 --- a/src/version.c +++ b/src/version.c @@ -758,6 +758,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 855, /**/ 854, /**/