Support runInTerminal (sort of)
This commit is contained in:
parent
689b006b6f
commit
62e9335a10
3 changed files with 43 additions and 0 deletions
|
|
@ -165,3 +165,33 @@ class CodeView( object ):
|
|||
'vimspectorBP' if breakpoint[ 'verified' ]
|
||||
else 'vimspectorBPDisabled',
|
||||
file_name ) )
|
||||
|
||||
|
||||
def LaunchTerminal( self, params ):
|
||||
# kind = params.get( 'kind', 'integrated' )
|
||||
|
||||
# FIXME: We don't support external terminals, and only open in the
|
||||
# integrated one.
|
||||
|
||||
cwd = params[ 'cwd' ]
|
||||
args = params[ 'args' ]
|
||||
env = params.get( 'env', {} )
|
||||
|
||||
options = {
|
||||
'vertical': 1,
|
||||
'norestore': 1,
|
||||
'cwd': cwd,
|
||||
'env': env,
|
||||
}
|
||||
|
||||
with utils.TemporaryVimOptions( { 'splitright': True,
|
||||
'equalalways': False } ):
|
||||
with utils.RestoreCurrentWindow():
|
||||
vim.current.window = self._window
|
||||
# TODO/FIXME: Do something about closing this when we reset ?
|
||||
vim_cmd = 'term_start( {}, {} )'.format( json.dumps( args ),
|
||||
json.dumps( options ) )
|
||||
|
||||
self._logger.debug( 'Start terminal: {}'.format( vim_cmd ) )
|
||||
|
||||
vim.eval( vim_cmd )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue