Skip to content

Commit 826326f

Browse files
zeertzjqchrisbra
authored andcommitted
patch 9.1.1871: Wrong 'showcmd' in the cmdwin
Problem: Wrong 'showcmd' in the command-line window. Solution: Clear 'showcmd' when entering cmdwin (zeertzjq). related: neovim/neovim#36271 closes: #18616 Signed-off-by: zeertzjq <[email protected]> Signed-off-by: Christian Brabandt <[email protected]>
1 parent bbf4a10 commit 826326f

5 files changed

Lines changed: 68 additions & 0 deletions

File tree

src/ex_getln.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4846,6 +4846,7 @@ open_cmdwin(void)
48464846

48474847
State = MODE_NORMAL;
48484848
setmouse();
4849+
clear_showcmd();
48494850

48504851
// Reset here so it can be set by a CmdwinEnter autocommand.
48514852
cmdwin_result = 0;
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
| +0&#ffffff0@74
2+
|~+0#4040ff13&| @73
3+
|~| @73
4+
|~| @73
5+
|~| @73
6+
|~| @73
7+
|~| @73
8+
|~| @73
9+
|[+1#0000000&|N|o| |N|a|m|e|]| @47|0|,|0|-|1| @9|A|l@1
10+
|:+0#4040ff13&> +0#0000000&@73
11+
|~+0#4040ff13&| @73
12+
|~| @73
13+
|~| @73
14+
|~| @73
15+
|~| @73
16+
|~| @73
17+
|[+3#0000000&|C|o|m@1|a|n|d| |L|i|n|e|]| @42|1|,|0|-|1| @9|A|l@1
18+
|:+0&&| @73
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
> +0&#ffffff0@74
2+
|~+0#4040ff13&| @73
3+
|~| @73
4+
|~| @73
5+
|~| @73
6+
|~| @73
7+
|~| @73
8+
|~| @73
9+
|~| @73
10+
|~| @73
11+
|~| @73
12+
|~| @73
13+
|~| @73
14+
|~| @73
15+
|~| @73
16+
|~| @73
17+
|~| @73
18+
| +0#0000000&@56|0|,|0|-|1| @8|A|l@1|

src/testdir/test_cmdwin.vim

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,4 +582,33 @@ func Test_cmdwin_existing_bufname()
582582
delfunc CheckName
583583
endfunc
584584

585+
func Test_cmdwin_showcmd()
586+
CheckScreendump
587+
588+
let lines =<< trim [SCRIPT]
589+
augroup vimHints | au! | augroup END
590+
set showcmd
591+
[SCRIPT]
592+
call writefile(lines, 'XTest_cmdwin_showcmd', 'D')
593+
let buf = RunVimInTerminal('-S XTest_cmdwin_showcmd', {'rows': 18})
594+
595+
for keys in ['q:', ":\<C-F>"]
596+
call term_sendkeys(buf, keys)
597+
call VerifyScreenDump(buf, 'Test_cmdwin_showcmd_1', {})
598+
call term_sendkeys(buf, '"')
599+
call WaitForAssert({-> assert_match('^: \+" *$', term_getline(buf, 18))})
600+
call term_sendkeys(buf, 'x')
601+
call WaitForAssert({-> assert_match('^: \+"x *$', term_getline(buf, 18))})
602+
call term_sendkeys(buf, 'y')
603+
call WaitForAssert({-> assert_match('^: \+"xy *$', term_getline(buf, 18))})
604+
call term_sendkeys(buf, 'y')
605+
call WaitForAssert({-> assert_match('^: \+$', term_getline(buf, 18))})
606+
call term_sendkeys(buf, "\<C-C>\<C-C>")
607+
call VerifyScreenDump(buf, 'Test_cmdwin_showcmd_2', {})
608+
endfor
609+
610+
" clean up
611+
call StopVimInTerminal(buf)
612+
endfunc
613+
585614
" vim: shiftwidth=2 sts=2 expandtab

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,8 @@ static char *(features[]) =
734734

735735
static int included_patches[] =
736736
{ /* Add new patch number below this line */
737+
/**/
738+
1871,
737739
/**/
738740
1870,
739741
/**/

0 commit comments

Comments
 (0)