diff options
-rw-r--r-- | autoload/sonictemplate.vim | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/autoload/sonictemplate.vim b/autoload/sonictemplate.vim index 41093fc..13c1651 100644 --- a/autoload/sonictemplate.vim +++ b/autoload/sonictemplate.vim @@ -1,7 +1,7 @@ "============================================================================= " sonictemplate.vim " Author: Yasuhiro Matsumoto <mattn.jp@gmail.com> -" Last Change: 11-Jun-2012. +" Last Change: 27-Jun-2012. let s:save_cpo = &cpo set cpo&vim @@ -164,6 +164,8 @@ function! sonictemplate#apply(name, mode, ...) abort let c = indent . substitute(substitute(c, "\n", "\n".indent, 'g'), "\n".indent."\n", "\n\n", 'g') if len(indent) && (&expandtab || &tabstop != &shiftwidth || indent =~ '^ \+$') let c = substitute(c, "\t", repeat(' ', min([len(indent), &shiftwidth])), 'g') + elseif &expandtab || &tabstop != &shiftwidth + let c = substitute(c, "\t", repeat(' ', &shiftwidth), 'g') endif silent! put! =c endif |