fix tabpage errors
This commit is contained in:
parent
1473e9d23b
commit
cee10c8187
5 changed files with 97 additions and 29 deletions
|
|
@ -147,11 +147,13 @@ def RestoreCursorPosition():
|
|||
|
||||
@contextlib.contextmanager
|
||||
def RestoreCurrentWindow():
|
||||
# TODO: Don't trigger autoccommands when shifting windows
|
||||
# TODO: Don't trigger autocommands when shifting windows
|
||||
old_tabpage = vim.current.tabpage
|
||||
old_window = vim.current.window
|
||||
try:
|
||||
yield
|
||||
finally:
|
||||
vim.current.tabpage = old_tabpage
|
||||
vim.current.window = old_window
|
||||
|
||||
|
||||
|
|
@ -167,6 +169,18 @@ def RestoreCurrentBuffer( window ):
|
|||
vim.current.buffer = old_buffer
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def LetCurrentWindow( window ):
|
||||
with RestoreCurrentWindow():
|
||||
JumpToWindow( window )
|
||||
yield
|
||||
|
||||
|
||||
def JumpToWindow( window ):
|
||||
vim.current.tabpage = window.tabpage
|
||||
vim.current.window = window
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def TemporaryVimOptions( opts ):
|
||||
old_value = {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue