From f889cdb367a33c5d57ef045f778248dfbcc1b97a Mon Sep 17 00:00:00 2001 From: Shintaro Kaneko Date: Tue, 29 May 2012 01:40:34 -0700 Subject: Improve expanding templates for blank lines --- autoload/sonictemplate.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/sonictemplate.vim b/autoload/sonictemplate.vim index b9bee73..6f0978a 100644 --- a/autoload/sonictemplate.vim +++ b/autoload/sonictemplate.vim @@ -112,7 +112,7 @@ function! sonictemplate#apply(name, mode) abort if line =~ '^\s*$' && line('.') != line('$') silent! normal dd endif - let c = indent . substitute(c, "\n", "\n".indent, 'g') + 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') endif -- cgit v1.2.3-54-g00ecf