@@ -229,22 +229,24 @@ function! xolox#misc#async#periodic_callback() " {{{1
229229 " process the response.
230230 "
231231 " [CursorHold]: http://vimdoc.sourceforge.net/htmldoc/autocmd.html#CursorHold
232- let num_processed = 0
233- call xolox#misc#msg#debug (" vim-misc %s: Checking for asynchronous responses (%i responses not yet received) .." , g: xolox #misc#version , len (g: xolox #misc#async#requests))
234- for unique_number in sort (keys (g: xolox #misc#async#requests))
235- let request = g: xolox #misc#async#requests[unique_number]
236- let temporary_file = get (request, ' temporary_file' , ' ' )
237- if ! empty (temporary_file) && getfsize (temporary_file) > 0
238- try
239- call xolox#misc#msg#debug (" vim-misc %s: Found asynchronous response by %s in %s .." , g: xolox #misc#version , request[' function' ], temporary_file)
240- call xolox#misc#async#callback_to_parent (xolox#misc#persist#load (temporary_file))
241- let num_processed += 1
242- finally
243- call delete (temporary_file)
244- endtry
245- endif
246- endfor
247- call xolox#misc#msg#debug (" vim-misc %s: Processed %i asynchronous responses (%i responses not yet received)." , g: xolox #misc#version , num_processed, len (g: xolox #misc#async#requests))
232+ if ! empty (g: xolox #misc#async#requests)
233+ let num_processed = 0
234+ call xolox#misc#msg#debug (" vim-misc %s: Checking for asynchronous responses (%i responses not yet received) .." , g: xolox #misc#version , len (g: xolox #misc#async#requests))
235+ for unique_number in sort (keys (g: xolox #misc#async#requests))
236+ let request = g: xolox #misc#async#requests[unique_number]
237+ let temporary_file = get (request, ' temporary_file' , ' ' )
238+ if ! empty (temporary_file) && getfsize (temporary_file) > 0
239+ try
240+ call xolox#misc#msg#debug (" vim-misc %s: Found asynchronous response by %s in %s .." , g: xolox #misc#version , request[' function' ], temporary_file)
241+ call xolox#misc#async#callback_to_parent (xolox#misc#persist#load (temporary_file))
242+ let num_processed += 1
243+ finally
244+ call delete (temporary_file)
245+ endtry
246+ endif
247+ endfor
248+ call xolox#misc#msg#debug (" vim-misc %s: Processed %i asynchronous responses (%i responses not yet received)." , g: xolox #misc#version , num_processed, len (g: xolox #misc#async#requests))
249+ endif
248250endfunction
249251
250252" }}}1
0 commit comments