From 5a461cfb634f26d0d237e71b4da2899e2015c986 Mon Sep 17 00:00:00 2001 From: Michael Sanders Date: Wed, 25 Mar 2009 16:32:39 -0400 Subject: [PATCH] fixed bug when cancelling a snippet with multiple matches --- plugin/snipMate.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/snipMate.vim b/plugin/snipMate.vim index ef8087c..415abe2 100644 --- a/plugin/snipMate.vim +++ b/plugin/snipMate.vim @@ -120,7 +120,7 @@ fun s:ChooseSnippet(scope, trigger) endfor if i == 2 | return s:multi_snips[a:scope][a:trigger][0][1] | endif let num = inputlist(snippet) - 1 - return num < i-1 ? s:multi_snips[a:scope][a:trigger][num][1] : '' + return num == -1 ? '' : s:multi_snips[a:scope][a:trigger][num][1] endf fun! TriggerSnippet() @@ -149,7 +149,7 @@ fun! TriggerSnippet() " If word is a trigger for a snippet, delete the trigger & expand the snippet. if exists('s:snippet') if s:snippet == '' " If user cancelled a multi snippet, quit. - return unl s:snippet + unl s:snippet | return '' endif let col = col('.') - len(trigger) sil exe 's/'.escape(trigger, '.^$/\*[]').'\%#//'