summaryrefslogtreecommitdiff
path: root/src/testdir/test_cmdline.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-04-19 11:38:24 +0100
committerBram Moolenaar <Bram@vim.org>2022-04-19 11:38:24 +0100
commita653e53b1f4ba08de0dbcea06288cf0cc1c6e752 (patch)
treef4b9c57d97d42e2451ebb71cd35a77a787a36534 /src/testdir/test_cmdline.vim
parentbac9a9e5c233dcf9cf734c61e4e4311fe57eccd1 (diff)
downloadvim-git-a653e53b1f4ba08de0dbcea06288cf0cc1c6e752.tar.gz
patch 8.2.4789: cursor pos wrong when using :redraw while editing the cmdlinev8.2.4789
Problem: The cursor may be in the in wrong place when using :redraw while editing the cmdline. Solution: When editing the command line let :redraw update the command line too. (closes #10210)
Diffstat (limited to 'src/testdir/test_cmdline.vim')
-rw-r--r--src/testdir/test_cmdline.vim22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim
index 8baa1ac6f..8d556faf0 100644
--- a/src/testdir/test_cmdline.vim
+++ b/src/testdir/test_cmdline.vim
@@ -193,6 +193,28 @@ func Test_wildmenu_screendump()
call delete('XTest_wildmenu')
endfunc
+func Test_redraw_in_autocmd()
+ CheckScreendump
+
+ let lines =<< trim END
+ set cmdheight=2
+ autocmd CmdlineChanged * redraw
+ END
+ call writefile(lines, 'XTest_redraw')
+
+ let buf = RunVimInTerminal('-S XTest_redraw', {'rows': 8})
+ call term_sendkeys(buf, ":for i in range(3)\<CR>")
+ call VerifyScreenDump(buf, 'Test_redraw_in_autocmd_1', {})
+
+ call term_sendkeys(buf, "let i =")
+ call VerifyScreenDump(buf, 'Test_redraw_in_autocmd_2', {})
+
+ " clean up
+ call term_sendkeys(buf, "\<CR>")
+ call StopVimInTerminal(buf)
+ call delete('XTest_redraw')
+endfunc
+
func Test_map_completion()
call feedkeys(":map <unique> <si\<Tab>\<Home>\"\<CR>", 'xt')
call assert_equal('"map <unique> <silent>', getreg(':'))