@contextmanager
def use_proxy_buffer(snippets_stack, vstate):
 buffer_proxy = VimBufferProxy(snippets_stack, vstate)
 old_buffer = _vim.buf
 try:
  _vim.buf = buffer_proxy
  (yield)
 finally:
  _vim.buf = old_buffer
 buffer_proxy.validate_buffer()

@ contextmanager def use_proxy_buffer ( snippets_stack , vstate ) : buffer_proxy = VimBufferProxy ( snippets_stack , vstate ) old_buffer = _vim . buf try : _vim . buf = buffer_proxy ( yield ) finally : _vim . buf = old_buffer buffer_proxy . validate_buffer ( )
forward all changes made in the buffer to the current snippet stack while function call .