From 73352257e4f3db8641e54b529a340b8bd3d9a3a5 Mon Sep 17 00:00:00 2001 From: Aaron Schrab Date: Tue, 31 Jul 2012 15:01:15 -0400 Subject: [PATCH] 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. --- plugin/UltiSnips/_vim.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugin/UltiSnips/_vim.py b/plugin/UltiSnips/_vim.py index 18be1df..565a562 100755 --- a/plugin/UltiSnips/_vim.py +++ b/plugin/UltiSnips/_vim.py @@ -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):