Skip to content

Commit

Permalink
Set the code window to the current buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
puremourning committed Feb 16, 2020
1 parent 926029e commit c4bedce
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion python3/vimspector/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@


class CodeView( object ):
def __init__( self, window, api_prefix ):
def __init__( self, window, original_window, api_prefix ):
self._window = window
self._api_prefix = api_prefix

Expand All @@ -40,7 +40,9 @@ def __init__( self, window, api_prefix ):
'breakpoints': []
}


with utils.LetCurrentWindow( self._window ):
vim.current.buffer = original_window.buffer
vim.command( 'nnoremenu WinBar.Continue :call vimspector#Continue()<CR>' )
vim.command( 'nnoremenu WinBar.Next :call vimspector#StepOver()<CR>' )
vim.command( 'nnoremenu WinBar.Step :call vimspector#StepInto()<CR>' )
Expand Down
6 changes: 5 additions & 1 deletion python3/vimspector/debug_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,11 +445,15 @@ def GetCompletionsSync( self, text_line, column_in_bytes ):


def _SetUpUI( self ):
original_window = vim.current.window

vim.command( 'tabnew' )
self._uiTab = vim.current.tabpage

# Code window
self._codeView = code.CodeView( vim.current.window, self._api_prefix )
self._codeView = code.CodeView( vim.current.window,
original_window,
self._api_prefix )

# Call stack
with utils.TemporaryVimOptions( { 'splitright': False,
Expand Down

0 comments on commit c4bedce

Please sign in to comment.