diff options
author | Shintaro Kaneko <kaneshin0120@gmail.com> | 2012-05-29 01:40:34 -0700 |
---|---|---|
committer | Shintaro Kaneko <kaneshin0120@gmail.com> | 2012-05-29 01:40:34 -0700 |
commit | f889cdb367a33c5d57ef045f778248dfbcc1b97a (patch) | |
tree | 23b218b5c6e9b0b2d7fca110bd875f160e4a776d | |
parent | 226b8c75c271e5f24fb5768f66ff8e8b5b14f256 (diff) | |
download | vim-sonictemplate-f889cdb367a33c5d57ef045f778248dfbcc1b97a.tar.gz vim-sonictemplate-f889cdb367a33c5d57ef045f778248dfbcc1b97a.tar.bz2 vim-sonictemplate-f889cdb367a33c5d57ef045f778248dfbcc1b97a.zip |
Improve expanding templates for blank lines
-rw-r--r-- | autoload/sonictemplate.vim | 2 |
1 files changed, 1 insertions, 1 deletions
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 |