Use a list comprehension and try and catch some nasites
This commit is contained in:
parent
e216bc291d
commit
541686712c
2 changed files with 15 additions and 2 deletions
|
|
@ -138,12 +138,16 @@ function! vimspector#internal#job#StartCommandWithLog( cmd, category )
|
|||
\ 'stoponexit': 'kill'
|
||||
\ } ) )
|
||||
|
||||
if job_status( s:commands[ a:category ][ index ] ) !=# 'run'
|
||||
echom "Unable to start job for " . a:cmd
|
||||
return v:none
|
||||
endif
|
||||
|
||||
let l:stdout = ch_getbufnr(
|
||||
\ job_getchannel( s:commands[ a:category ][ index ] ), 'out' )
|
||||
let l:stderr = ch_getbufnr(
|
||||
\ job_getchannel( s:commands[ a:category ][ index ] ), 'err' )
|
||||
|
||||
|
||||
return [ l:stdout, l:stderr ]
|
||||
endfunction
|
||||
|
||||
|
|
|
|||
|
|
@ -58,7 +58,16 @@ def SetUpCommandBuffer( cmd, name ):
|
|||
json.dumps( cmd ),
|
||||
name ) )
|
||||
|
||||
return ( vim.buffers[ bufnr ] for bufnr in bufs )
|
||||
if bufs is None:
|
||||
raise RuntimeError( "Unable to start job {}: {}".format( cmd, name ) )
|
||||
elif not all( [ b > 0 for b in bufs ] ):
|
||||
raise RuntimeError( "Unable to get all streams for job {}: {}".format(
|
||||
name,
|
||||
cmd ) )
|
||||
|
||||
UserMessage( 'Bufs: {}'.format( [ int(b) for b in bufs ] ), persist = True )
|
||||
|
||||
return [ vim.buffers[ b ] for b in bufs ]
|
||||
|
||||
|
||||
def CleanUpCommand( name ):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue