aboutsummaryrefslogtreecommitdiff
path: root/test/functional/core/job_spec.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-11-10 15:24:36 +0800
committerGitHub <noreply@github.com>2023-11-10 15:24:36 +0800
commitd5a85d737aa2a5c3a64ef0aa5b01672b7ed49c09 (patch)
treed3ade990979b1c8f0ad3890fc8a6eb5b90848f68 /test/functional/core/job_spec.lua
parentbf5cf8ae82f2a164fba6ae063e0f5b7cb7c1df7b (diff)
downloadrneovim-d5a85d737aa2a5c3a64ef0aa5b01672b7ed49c09.tar.gz
rneovim-d5a85d737aa2a5c3a64ef0aa5b01672b7ed49c09.tar.bz2
rneovim-d5a85d737aa2a5c3a64ef0aa5b01672b7ed49c09.zip
fix(f_wait): flush UI before blocking (#25962)
Diffstat (limited to 'test/functional/core/job_spec.lua')
-rw-r--r--test/functional/core/job_spec.lua38
1 files changed, 27 insertions, 11 deletions
diff --git a/test/functional/core/job_spec.lua b/test/functional/core/job_spec.lua
index befbd4bc3b..038368c387 100644
--- a/test/functional/core/job_spec.lua
+++ b/test/functional/core/job_spec.lua
@@ -875,25 +875,41 @@ describe('jobs', function()
end)
end)
- it('hides cursor when waiting', function()
- local screen = Screen.new(30, 3)
+ it('hides cursor and flushes messages before blocking', function()
+ local screen = Screen.new(50, 6)
screen:set_default_attr_ids({
- [0] = {foreground = Screen.colors.Blue1, bold = true};
+ [0] = {foreground = Screen.colors.Blue, bold = true}; -- NonText
+ [1] = {bold = true, reverse = true}; -- MsgSeparator
+ [2] = {bold = true, foreground = Screen.colors.SeaGreen}; -- MoreMsg
})
screen:attach()
command([[let g:id = jobstart([v:progpath, '--clean', '--headless'])]])
- feed_command('call jobwait([g:id], 300)')
+ source([[
+ func PrintAndWait()
+ echon "aaa\nbbb"
+ call jobwait([g:id], 300)
+ echon "\nccc"
+ endfunc
+ ]])
+ feed_command('call PrintAndWait()')
screen:expect{grid=[[
- |
- {0:~ }|
- :call jobwait([g:id], 300) |
+ |
+ {0:~ }|
+ {0:~ }|
+ {1: }|
+ aaa |
+ bbb |
]], timeout=100}
- funcs.jobstop(meths.get_var('id'))
screen:expect{grid=[[
- ^ |
- {0:~ }|
- :call jobwait([g:id], 300) |
+ |
+ {1: }|
+ aaa |
+ bbb |
+ ccc |
+ {2:Press ENTER or type command to continue}^ |
]]}
+ feed('<CR>')
+ funcs.jobstop(meths.get_var('id'))
end)
end)