FixUp: Closing the output window causes errors on output
This commit is contained in:
parent
f8cbb7c5b6
commit
80afb153b9
3 changed files with 44 additions and 9 deletions
|
|
@ -157,11 +157,13 @@ class OutputView( object ):
|
|||
|
||||
|
||||
def _CreateBuffer( self, category, file_name = None, cmd = None ):
|
||||
if not self._window.valid:
|
||||
return
|
||||
win = self._window
|
||||
if not win.valid:
|
||||
# We need to borrow the current window
|
||||
win = vim.current.window
|
||||
|
||||
with utils.LetCurrentWindow( self._window ):
|
||||
with utils.RestoreCurrentBuffer( self._window ):
|
||||
with utils.LetCurrentWindow( win ):
|
||||
with utils.RestoreCurrentBuffer( win ):
|
||||
|
||||
if file_name is not None:
|
||||
assert cmd is None
|
||||
|
|
|
|||
|
|
@ -184,8 +184,10 @@ def RestoreCurrentWindow():
|
|||
try:
|
||||
yield
|
||||
finally:
|
||||
vim.current.tabpage = old_tabpage
|
||||
vim.current.window = old_window
|
||||
if old_tabpage.valid:
|
||||
vim.current.tabpage = old_tabpage
|
||||
if old_window.valid:
|
||||
vim.current.window = old_window
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
|
|
@ -194,9 +196,10 @@ def RestoreCurrentBuffer( window ):
|
|||
try:
|
||||
yield
|
||||
finally:
|
||||
with RestoreCurrentWindow():
|
||||
vim.current.window = window
|
||||
vim.current.buffer = old_buffer
|
||||
if window.valid:
|
||||
with RestoreCurrentWindow():
|
||||
vim.current.window = window
|
||||
vim.current.buffer = old_buffer
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue