This repository was archived by the owner on Mar 6, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +22
-8
lines changed
Expand file tree Collapse file tree 1 file changed +22
-8
lines changed Original file line number Diff line number Diff line change @@ -123,19 +123,33 @@ function! gen_tags#echo(str) abort
123123 endif
124124endfunction
125125
126+ function ! s: job_stdout (job_id, data, ... ) abort
127+ call gen_tags#echo (a: data )
128+ endfunction
129+
126130function ! s: job_start (cmd, ... ) abort
127131 if has (' nvim' )
128- if a: 0 == 0
129- let l: job_id = jobstart (a: cmd )
130- else
131- let l: job_id = jobstart (a: cmd , {' on_exit' : a: 1 })
132+ let l: job = {
133+ \ ' on_stdout' : function (' s:job_stdout' ),
134+ \ ' on_stderr' : function (' s:job_stdout' ),
135+ \ }
136+
137+ if a: 0 != 0
138+ let l: job .on_exit = a: 1
132139 endif
140+
141+ let l: job_id = jobstart (a: cmd , l: job )
133142 elseif has (' job' )
134- if a: 0 == 0
135- let l: job_id = job_start (a: cmd )
136- else
137- let l: job_id = job_start (a: cmd , {' close_cb' : a: 1 })
143+ let l: job = {
144+ \ ' out_cb' : function (' s:job_stdout' ),
145+ \ ' err_cb' : function (' s:job_stdout' ),
146+ \ }
147+
148+ if a: 0 != 0
149+ let l: job .exit_cb = a: 1
138150 endif
151+
152+ let l: job_id = job_start (a: cmd , l: job )
139153 else
140154 if has (' unix' )
141155 let l: cmd = a: cmd . ' &'
You can’t perform that action at this time.
0 commit comments