From 7af911d7d826d0d3aded042285d91f32d36c0f3d Mon Sep 17 00:00:00 2001 From: fish-face Date: Tue, 21 Jan 2014 15:13:40 +0000 Subject: [PATCH] Don't replace placeholders incorrectly when expandtab=0 Fixes issue #143 --- autoload/snipMate.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/snipMate.vim b/autoload/snipMate.vim index 19304995..8b7fbefb 100644 --- a/autoload/snipMate.vim +++ b/autoload/snipMate.vim @@ -79,7 +79,7 @@ fun! snipMate#expandSnip(snip, col) endif " Insert snippet with proper indentation - let indent = indent(lnum) + 1 + let indent = match(line, '\S\|$') + 1 call setline(lnum, line . snipLines[0]) call append(lnum, map(snipLines[1:], "empty(v:val) ? v:val : '" . strpart(line, 0, indent - 1) . "' . v:val"))