mirror of
https://github.com/neovim/neovim.git
synced 2025-11-08 03:25:05 +00:00
Make VimL code compatible with merged Partial support (#5765)
Closes #5763.
This commit is contained in:
@@ -25,7 +25,7 @@ function! s:version_cmp(a, b) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Handler for s:system() function.
|
" Handler for s:system() function.
|
||||||
function! s:system_handler(jobid, data, event) abort
|
function! s:system_handler(jobid, data, event) dict abort
|
||||||
if a:event == 'stdout' || a:event == 'stderr'
|
if a:event == 'stdout' || a:event == 'stderr'
|
||||||
let self.output .= join(a:data, '')
|
let self.output .= join(a:data, '')
|
||||||
elseif a:event == 'exit'
|
elseif a:event == 'exit'
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ endfunction
|
|||||||
|
|
||||||
|
|
||||||
" Job handler that simply forwards lines to the parser.
|
" Job handler that simply forwards lines to the parser.
|
||||||
function! s:JobOutput(id, lines)
|
function! s:JobOutput(_id, lines, _event) dict
|
||||||
call self._parser.feed(a:lines)
|
call self._parser.feed(a:lines)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
@@ -368,11 +368,11 @@ describe('jobs', function()
|
|||||||
eq({'notification', 'wait', {{-2}}}, next_msg())
|
eq({'notification', 'wait', {{-2}}}, next_msg())
|
||||||
end)
|
end)
|
||||||
|
|
||||||
pending('can be called recursively', function()
|
it('can be called recursively', function()
|
||||||
source([[
|
source([[
|
||||||
let g:opts = {}
|
let g:opts = {}
|
||||||
let g:counter = 0
|
let g:counter = 0
|
||||||
function g:opts.on_stdout(id, msg)
|
function g:opts.on_stdout(id, msg, _event)
|
||||||
if self.state == 0
|
if self.state == 0
|
||||||
if self.counter < 10
|
if self.counter < 10
|
||||||
call Run()
|
call Run()
|
||||||
@@ -390,7 +390,7 @@ describe('jobs', function()
|
|||||||
call jobclose(a:id, 'stdin')
|
call jobclose(a:id, 'stdin')
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
function g:opts.on_exit()
|
function g:opts.on_exit(...)
|
||||||
call rpcnotify(g:channel, 'w', printf('job %d exited', self.counter))
|
call rpcnotify(g:channel, 'w', printf('job %d exited', self.counter))
|
||||||
endfunction
|
endfunction
|
||||||
function Run()
|
function Run()
|
||||||
|
|||||||
Reference in New Issue
Block a user