mirror of
https://github.com/vim/vim.git
synced 2025-11-13 22:54:27 -05:00
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 <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
bbf4a10fe4
commit
826326f13b
@@ -4846,6 +4846,7 @@ open_cmdwin(void)
|
||||
|
||||
State = MODE_NORMAL;
|
||||
setmouse();
|
||||
clear_showcmd();
|
||||
|
||||
// Reset here so it can be set by a CmdwinEnter autocommand.
|
||||
cmdwin_result = 0;
|
||||
|
||||
18
src/testdir/dumps/Test_cmdwin_showcmd_1.dump
Normal file
18
src/testdir/dumps/Test_cmdwin_showcmd_1.dump
Normal file
@@ -0,0 +1,18 @@
|
||||
| +0&#ffffff0@74
|
||||
|~+0#4040ff13&| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|[+1#0000000&|N|o| |N|a|m|e|]| @47|0|,|0|-|1| @9|A|l@1
|
||||
|:+0#4040ff13&> +0#0000000&@73
|
||||
|~+0#4040ff13&| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|[+3#0000000&|C|o|m@1|a|n|d| |L|i|n|e|]| @42|1|,|0|-|1| @9|A|l@1
|
||||
|:+0&&| @73
|
||||
18
src/testdir/dumps/Test_cmdwin_showcmd_2.dump
Normal file
18
src/testdir/dumps/Test_cmdwin_showcmd_2.dump
Normal file
@@ -0,0 +1,18 @@
|
||||
> +0&#ffffff0@74
|
||||
|~+0#4040ff13&| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
| +0#0000000&@56|0|,|0|-|1| @8|A|l@1|
|
||||
@@ -582,4 +582,33 @@ func Test_cmdwin_existing_bufname()
|
||||
delfunc CheckName
|
||||
endfunc
|
||||
|
||||
func Test_cmdwin_showcmd()
|
||||
CheckScreendump
|
||||
|
||||
let lines =<< trim [SCRIPT]
|
||||
augroup vimHints | au! | augroup END
|
||||
set showcmd
|
||||
[SCRIPT]
|
||||
call writefile(lines, 'XTest_cmdwin_showcmd', 'D')
|
||||
let buf = RunVimInTerminal('-S XTest_cmdwin_showcmd', {'rows': 18})
|
||||
|
||||
for keys in ['q:', ":\<C-F>"]
|
||||
call term_sendkeys(buf, keys)
|
||||
call VerifyScreenDump(buf, 'Test_cmdwin_showcmd_1', {})
|
||||
call term_sendkeys(buf, '"')
|
||||
call WaitForAssert({-> assert_match('^: \+" *$', term_getline(buf, 18))})
|
||||
call term_sendkeys(buf, 'x')
|
||||
call WaitForAssert({-> assert_match('^: \+"x *$', term_getline(buf, 18))})
|
||||
call term_sendkeys(buf, 'y')
|
||||
call WaitForAssert({-> assert_match('^: \+"xy *$', term_getline(buf, 18))})
|
||||
call term_sendkeys(buf, 'y')
|
||||
call WaitForAssert({-> assert_match('^: \+$', term_getline(buf, 18))})
|
||||
call term_sendkeys(buf, "\<C-C>\<C-C>")
|
||||
call VerifyScreenDump(buf, 'Test_cmdwin_showcmd_2', {})
|
||||
endfor
|
||||
|
||||
" clean up
|
||||
call StopVimInTerminal(buf)
|
||||
endfunc
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
||||
@@ -734,6 +734,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
1871,
|
||||
/**/
|
||||
1870,
|
||||
/**/
|
||||
|
||||
Reference in New Issue
Block a user