From 30738b2176721f69b3216e1287af72cc091502c6 Mon Sep 17 00:00:00 2001 From: "rygwdn@gmail.com" <> Date: Fri, 4 Feb 2011 20:02:30 -0400 Subject: [PATCH 1/2] Use faster, cleaner method for modifying the path. --- plugin/UltiSnips.vim | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/plugin/UltiSnips.vim b/plugin/UltiSnips.vim index a94197e..5e247ea 100644 --- a/plugin/UltiSnips.vim +++ b/plugin/UltiSnips.vim @@ -188,12 +188,8 @@ endf python << EOF import vim, os, sys -for p in vim.eval("&runtimepath").split(','): - dname = p + os.path.sep + "plugin" - if os.path.exists(dname + os.path.sep + "UltiSnips"): - if dname not in sys.path: - sys.path.append(dname) - break +new_path = vim.eval('expand(":h")') +sys.path.append(new_path) from UltiSnips import UltiSnips_Manager UltiSnips_Manager.expand_trigger = vim.eval("g:UltiSnipsExpandTrigger") From 386e0a6a9bc46278d82fa9e75f9abb3edf17c72f Mon Sep 17 00:00:00 2001 From: "rygwdn@gmail.com" <> Date: Fri, 4 Feb 2011 20:09:28 -0400 Subject: [PATCH 2/2] Return true from expand_anon if the snippet was actually expanded. --- plugin/UltiSnips/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugin/UltiSnips/__init__.py b/plugin/UltiSnips/__init__.py index cb7d5c3..8d8fd64 100644 --- a/plugin/UltiSnips/__init__.py +++ b/plugin/UltiSnips/__init__.py @@ -665,6 +665,9 @@ class SnippetManager(object): if snip.matches(before): self._do_snippet(snip, before, after) + return True + else: + return False def clear_snippets(self, triggers = [], ft = "all"): if ft in self._snippets: