Fix opening folds inserted by snippets
Commit 13331a8 added code to show the current line after insertions, but later changes caused that to be called too soon. This left folds created by a snippet closed, and the cursor at the end of the insertion.
This commit is contained in:
parent
e9a783857b
commit
73352257e4
@ -64,10 +64,6 @@ buf = VimBuffer()
|
||||
def text_to_vim(start, end, text):
|
||||
lines = text.split('\n')
|
||||
|
||||
# Open any folds this might have created
|
||||
buf.cursor = start
|
||||
vim.command("normal zv")
|
||||
|
||||
new_end = _calc_end(lines, start)
|
||||
|
||||
before = buf[start.line][:start.col]
|
||||
@ -80,6 +76,10 @@ def text_to_vim(start, end, text):
|
||||
new_lines[-1] += after
|
||||
buf[start.line:end.line + 1] = new_lines
|
||||
|
||||
# Open any folds this might have created
|
||||
buf.cursor = start
|
||||
vim.command("normal zv")
|
||||
|
||||
return new_end
|
||||
|
||||
def escape(inp):
|
||||
|
Loading…
x
Reference in New Issue
Block a user