Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
  • 3 commits
  • 2 files changed
  • 0 commit comments
  • 2 contributors
Commits on Jul 31, 2012
@aschrab aschrab 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.
7335225
Commits on Aug 09, 2012
@aschrab aschrab Add test with perl syntax folding
Exercise changes from commit 7335225, to check that the problem fixed by
that doesn't recur.

I've run all tests including this one both with and without the
previously mentioned commit, the new test only passes if that commit is
included.  All other tests pass in either case.
3584ee3
Commits on Aug 22, 2012
@SirVer Fix for folding problem by Aaron 3fc86a3
Showing with 21 additions and 4 deletions.
  1. +4 −4 plugin/UltiSnips/_vim.py
  2. +17 −0 test.py
View
8 plugin/UltiSnips/_vim.py
@@ -66,10 +66,6 @@ def fset(self, pos):
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]
@@ -82,6 +78,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):
View
17 test.py
@@ -2587,6 +2587,23 @@ class Fold_DeleteMiddleLine_ECR(_VimTest):
# End: $1 `!p snip.rv = vim.eval("&foldmarker").split(",")[1]`""")
keys = "fold" + EX + "hi" + ESC + "jdd"
wanted = "# hi {{{\n\n# End: hi }}}"
+
+class PerlSyntaxFold(_VimTest):
+ def _options_on(self):
+ self.send(":set foldlevel=0\n")
+ self.send(":syntax enable\n")
+ self.send(":set foldmethod=syntax\n")
+ self.send(":let g:perl_fold = 1\n")
+ self.send(":so $VIMRUNTIME/syntax/perl.vim\n")
+ def _options_off(self):
+ self.send(":set foldmethod=manual\n")
+ self.send(":syntax clear\n")
+
+ snippets = ("test", r"""package ${1:`!v printf('c%02d', 3)`};
+${0}
+1;""")
+ keys = "test" + EX + JF + "sub junk {}"
+ wanted = "package c03;\nsub junk {}\n1;"
# End: Folding Interaction #}}}
# Cursor Movement {{{#

No commit comments for this range

Something went wrong with that request. Please try again.