VimBufferHelper -> VimBufferProxy
This commit is contained in:
parent
972305725f
commit
bc29e23226
@ -11,7 +11,7 @@ from contextlib import contextmanager
|
|||||||
|
|
||||||
@contextmanager
|
@contextmanager
|
||||||
def use_proxy_buffer(snippets_stack):
|
def use_proxy_buffer(snippets_stack):
|
||||||
buffer_proxy = VimBufferHelper(snippets_stack)
|
buffer_proxy = VimBufferProxy(snippets_stack)
|
||||||
old_buffer = _vim.buf
|
old_buffer = _vim.buf
|
||||||
try:
|
try:
|
||||||
_vim.buf = buffer_proxy
|
_vim.buf = buffer_proxy
|
||||||
@ -22,7 +22,7 @@ def use_proxy_buffer(snippets_stack):
|
|||||||
|
|
||||||
@contextmanager
|
@contextmanager
|
||||||
def suspend_proxy_edits():
|
def suspend_proxy_edits():
|
||||||
if not isinstance(_vim.buf, VimBufferHelper):
|
if not isinstance(_vim.buf, VimBufferProxy):
|
||||||
yield
|
yield
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
@ -31,7 +31,7 @@ def suspend_proxy_edits():
|
|||||||
finally:
|
finally:
|
||||||
_vim.buf._enable_edits()
|
_vim.buf._enable_edits()
|
||||||
|
|
||||||
class VimBufferHelper(_vim.VimBuffer):
|
class VimBufferProxy(_vim.VimBuffer):
|
||||||
def __init__(self, snippets_stack):
|
def __init__(self, snippets_stack):
|
||||||
self._snippets_stack = snippets_stack
|
self._snippets_stack = snippets_stack
|
||||||
self._buffer = vim.current.buffer
|
self._buffer = vim.current.buffer
|
||||||
|
Loading…
x
Reference in New Issue
Block a user