From 0875f5ea7b018d2e5d36fe3616d049380fd7e4fc Mon Sep 17 00:00:00 2001 From: Michael Sanders Date: Sat, 11 Jul 2009 12:06:23 -0400 Subject: [PATCH] fixed bug with variables at end of lines --- autoload/snipMate.vim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/autoload/snipMate.vim b/autoload/snipMate.vim index eebeeca..3273d34 100644 --- a/autoload/snipMate.vim +++ b/autoload/snipMate.vim @@ -141,14 +141,14 @@ fun s:BuildTabStops(snip, lnum, col, indent) let dots = repeat('.', snipPos[j][2]) call add(snipPos[j], []) let withoutOthers = substitute(a:snip, '${\d\+.\{-}}\|$'.i.'\@!\d\+', '', 'g') - while match(withoutOthers, '$'.i.'\D') != -1 - let beforeMark = matchstr(withoutOthers, '^.\{-}\ze'.dots.'$'.i.'\D') + while match(withoutOthers, '$'.i.'\(\D\|$\)') != -1 + let beforeMark = matchstr(withoutOthers, '^.\{-}\ze'.dots.'$'.i.'\(\D\|$\)') call add(snipPos[j][3], [0, 0]) let snipPos[j][3][-1][0] = a:lnum + s:Count(beforeMark, "\n") let snipPos[j][3][-1][1] = a:indent + (snipPos[j][3][-1][0] > a:lnum \ ? len(matchstr(beforeMark, '.*\n\zs.*')) \ : a:col + len(beforeMark)) - let withoutOthers = substitute(withoutOthers, '$'.i.'\ze\D', '', '') + let withoutOthers = substitute(withoutOthers, '$'.i.'\ze\(\D\|$\)', '', '') endw endif let i += 1