From 61c48352949cb5540445c2c62f4144db166b7420 Mon Sep 17 00:00:00 2001 From: Michael Sanders Date: Fri, 15 May 2009 12:01:43 -0400 Subject: [PATCH] fixed bug with updating tab stops when new lines are inserted --- autoload/snipMate.vim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/autoload/snipMate.vim b/autoload/snipMate.vim index e0b32d5..a5f1219 100644 --- a/autoload/snipMate.vim +++ b/autoload/snipMate.vim @@ -24,7 +24,7 @@ fun snipMate#expandSnip(snip, col) else let afterCursor = '' " For some reason the cursor needs to move one right after this - if line != '' && col == 1 && &ve !~ 'all\|onemore' + if line != '' && col == 1 && &ve != 'all' && &ve != 'onemore' let col += 1 endif endif @@ -230,6 +230,7 @@ fun s:UpdateTabStops() " Update the line number of all proceeding tab stops if has " been inserted. if changeLine != 0 + let changeLine -= 1 for pos in g:snipPos[s:curPos + 1:] if pos[0] >= lnum if pos[0] == lnum | let pos[1] += changeCol | endif @@ -365,7 +366,7 @@ fun s:UpdateVars() endif for nPos in g:snipPos[s:curPos][3][(i):] " This list is in ascending order, so quit if we've gone too far. - if nPos[0] > lnum | break | endif + if nPos[0] > lnum | break | endif if nPos[0] == lnum && nPos[1] > col let nPos[1] -= changeLen endif @@ -388,3 +389,4 @@ fun s:UpdateVars() let s:oldWord = newWord let g:snipPos[s:curPos][2] = newWordLen endf +" vim:noet:sw=4:ts=4:ft=vim