mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 22:18:33 +00:00
fix(jobs): do not block UI when jobwait() doesn't block (#31803)
(cherry picked from commit efe1732c6f
)
This commit is contained in:

committed by
github-actions[bot]
![github-actions[bot]](/assets/img/avatar_default.png)
parent
6a6c6b2658
commit
357ee88606
@@ -943,6 +943,40 @@ describe('jobs', function()
|
||||
feed('<CR>')
|
||||
fn.jobstop(api.nvim_get_var('id'))
|
||||
end)
|
||||
|
||||
it('does not set UI busy with zero timeout #31712', function()
|
||||
local screen = Screen.new(50, 6)
|
||||
screen:attach()
|
||||
command([[let g:id = jobstart(['sleep', '0.3'])]])
|
||||
local busy = 0
|
||||
screen._handle_busy_start = (function(orig)
|
||||
return function()
|
||||
orig(screen)
|
||||
busy = busy + 1
|
||||
end
|
||||
end)(screen._handle_busy_start)
|
||||
source([[
|
||||
func PrintAndPoll()
|
||||
echon "aaa\nbbb"
|
||||
call jobwait([g:id], 0)
|
||||
echon "\nccc"
|
||||
endfunc
|
||||
]])
|
||||
feed_command('call PrintAndPoll()')
|
||||
screen:expect {
|
||||
grid = [[
|
||||
|
|
||||
{3: }|
|
||||
aaa |
|
||||
bbb |
|
||||
ccc |
|
||||
{6:Press ENTER or type command to continue}^ |
|
||||
]],
|
||||
}
|
||||
feed('<CR>')
|
||||
fn.jobstop(api.nvim_get_var('id'))
|
||||
eq(0, busy)
|
||||
end)
|
||||
end)
|
||||
|
||||
pending('exit event follows stdout, stderr', function()
|
||||
|
Reference in New Issue
Block a user