aboutsummaryrefslogtreecommitdiff
path: root/test/functional/legacy/cmdline_spec.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-09-21 06:47:29 +0800
committerGitHub <noreply@github.com>2022-09-21 06:47:29 +0800
commitad1f353fe1aeb54144a34d1a0de8e318bd5113aa (patch)
treee8e99077e564c2ef87198b6ac9d0615567f35240 /test/functional/legacy/cmdline_spec.lua
parent585ab2564ada61c03443ed8f5709d2e5c8e0812a (diff)
downloadrneovim-ad1f353fe1aeb54144a34d1a0de8e318bd5113aa.tar.gz
rneovim-ad1f353fe1aeb54144a34d1a0de8e318bd5113aa.tar.bz2
rneovim-ad1f353fe1aeb54144a34d1a0de8e318bd5113aa.zip
vim-patch:9.0.0517: when at the command line :redrawstatus does not work well (#20266)
Problem: When at the command line :redrawstatus does not work well. Solution: Only update the statuslines instead of the screen. (closes vim/vim#11180) https://github.com/vim/vim/commit/320d910064320f894a09ffdd1cd800ff5371e97f
Diffstat (limited to 'test/functional/legacy/cmdline_spec.lua')
-rw-r--r--test/functional/legacy/cmdline_spec.lua53
1 files changed, 47 insertions, 6 deletions
diff --git a/test/functional/legacy/cmdline_spec.lua b/test/functional/legacy/cmdline_spec.lua
index 8325f7eeb0..49e3825693 100644
--- a/test/functional/legacy/cmdline_spec.lua
+++ b/test/functional/legacy/cmdline_spec.lua
@@ -175,7 +175,7 @@ describe('cmdline', function()
-- oldtest: Test_redrawstatus_in_autocmd()
it(':redrawstatus in cmdline mode', function()
- local screen = Screen.new(60, 6)
+ local screen = Screen.new(60, 8)
screen:set_default_attr_ids({
[0] = {bold = true, foreground = Screen.colors.Blue}, -- NonText
[1] = {bold = true, reverse = true}, -- MsgSeparator, StatusLine
@@ -184,13 +184,16 @@ describe('cmdline', function()
exec([[
set laststatus=2
set statusline=%=:%{getcmdline()}
- autocmd CmdlineChanged * if getcmdline() == 'foobar' | redrawstatus | endif
+ autocmd CmdlineChanged * redrawstatus
+ set display-=msgsep
]])
-- :redrawstatus is postponed if messages have scrolled
feed([[:echo "one\ntwo\nthree\nfour"<CR>]])
feed(':foobar')
screen:expect([[
- {1: }|
+ {0:~ }|
+ {0:~ }|
+ {1: :echo "one\ntwo\nthree\nfour"}|
one |
two |
three |
@@ -198,14 +201,52 @@ describe('cmdline', function()
:foobar^ |
]])
-- it is not postponed if messages have not scrolled
- feed('<Esc>:foobar')
+ feed('<Esc>:for in in range(3)')
screen:expect([[
|
{0:~ }|
{0:~ }|
{0:~ }|
- {1: :foobar}|
- :foobar^ |
+ {0:~ }|
+ {0:~ }|
+ {1: :for in in range(3)}|
+ :for in in range(3)^ |
+ ]])
+ -- with cmdheight=1 messages have scrolled when typing :endfor
+ feed('<CR>:endfor')
+ screen:expect([[
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {1: :for in in range(3)}|
+ :for in in range(3) |
+ : :endfor^ |
+ ]])
+ feed('<CR>:set cmdheight=2<CR>')
+ -- with cmdheight=2 messages haven't scrolled when typing :for or :endfor
+ feed(':for in in range(3)')
+ screen:expect([[
+ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {1: :for in in range(3)}|
+ :for in in range(3)^ |
+ |
+ ]])
+ feed('<CR>:endfor')
+ screen:expect([[
+ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {1: ::endfor}|
+ :for in in range(3) |
+ : :endfor^ |
]])
end)
end)