File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
autoload/vital/__vital__/System Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 7979" out_cb: function(stdout_msg), " call per line
8080" err_cb: function(stderr_msg), " call per line
8181" exit_cb: function(exit_code), " call on exit
82+ " timeout: Number(ms),
8283" }
8384function ! s: execute (command , options ) abort
8485 if ! type (a: options ) is s: TYPE_DICT
@@ -112,6 +113,12 @@ function! s:execute(command, options) abort
112113
113114 let job_id = jobstart ([&shell ] + args , options )
114115
116+ if has_key (a: options , ' timeout' )
117+ if a: options .timeout > 0
118+ call timer_start (a: options .timeout , {- > jobstop (job_id)})
119+ endif
120+ endif
121+
115122 return {
116123 \ ' stop' : function (' jobstop' , [job_id]),
117124 \ }
@@ -123,6 +130,12 @@ function! s:execute(command, options) abort
123130
124131 let job = job_start ([&shell ] + args , options )
125132
133+ if has_key (a: options , ' timeout' )
134+ if a: options .timeout > 0
135+ call timer_start (a: options .timeout , {- > job_stop (job)})
136+ endif
137+ endif
138+
126139 return {
127140 \ ' stop' : function (' job_stop' , [job]),
128141 \ }
You can’t perform that action at this time.
0 commit comments