diff options
author | Yasuhiro Matsumoto <mattn.jp@gmail.com> | 2019-10-02 10:06:35 +0900 |
---|---|---|
committer | Yasuhiro Matsumoto <mattn.jp@gmail.com> | 2019-10-02 10:06:35 +0900 |
commit | 7db10f422f61819a1a8f45d0dade1de17ecab2b6 (patch) | |
tree | 23618b619d03b4bd8ad16a14fb7ab20ded5648ba /autoload | |
parent | 31de6a5e48b65dface121e654e40e06de6bf364a (diff) | |
parent | 39cf197d0e46eeff8f905063ba5030e8690169b3 (diff) | |
download | vim-sonictemplate-7db10f422f61819a1a8f45d0dade1de17ecab2b6.tar.gz vim-sonictemplate-7db10f422f61819a1a8f45d0dade1de17ecab2b6.tar.bz2 vim-sonictemplate-7db10f422f61819a1a8f45d0dade1de17ecab2b6.zip |
Merge branch 'master' of https://github.com/mattn/sonictemplate-vim
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/sonictemplate.vim | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/autoload/sonictemplate.vim b/autoload/sonictemplate.vim index 9397efa..1fc6451 100644 --- a/autoload/sonictemplate.vim +++ b/autoload/sonictemplate.vim @@ -281,7 +281,7 @@ function! sonictemplate#apply(name, mode, ...) abort if !buffer_is_not_empty let c = substitute(c, '{{_inline_}}\s*', '', 'g') if &expandtab || (&shiftwidth && &tabstop != &shiftwidth) - let c = substitute(c, "\t", repeat(' ', &shiftwidth), 'g') + let c = substitute(c, "\t", repeat(' ', shiftwidth()), 'g') endif silent! %d _ silent! put = c @@ -309,9 +309,9 @@ function! sonictemplate#apply(name, mode, ...) abort endif let c = indent . substitute(substitute(c, "\n", "\n".indent, 'g'), "\n".indent."\n", "\n\n", 'g') if len(indent) && (&expandtab || (&shiftwidth && &tabstop != &shiftwidth) || indent =~ '^ \+$') - let c = substitute(c, "\t", repeat(' ', min([len(indent), &shiftwidth])), 'g') + let c = substitute(c, "\t", repeat(' ', min([len(indent), shiftwidth()])), 'g') elseif &expandtab || (&shiftwidth && &tabstop != &shiftwidth) - let c = substitute(c, "\t", repeat(' ', &shiftwidth), 'g') + let c = substitute(c, "\t", repeat(' ', shiftwidth()), 'g') endif if line('.') < line('$') silent! normal! dd @@ -360,9 +360,9 @@ function! sonictemplate#postfix() if c =~ "\n" let c = indent . substitute(substitute(c, "\n", "\n".indent, 'g'), "\n".indent."\n", "\n\n", 'g') if len(indent) && (&expandtab || (&shiftwidth && &tabstop != &shiftwidth) || indent =~ '^ \+$') - let c = substitute(c, "\t", repeat(' ', min([len(indent), &shiftwidth])), 'g') + let c = substitute(c, "\t", repeat(' ', min([len(indent), shiftwidth()])), 'g') elseif &expandtab || (&shiftwidth && &tabstop != &shiftwidth) - let c = substitute(c, "\t", repeat(' ', &shiftwidth), 'g') + let c = substitute(c, "\t", repeat(' ', shiftwidth()), 'g') endif call setline('.', line) if line('.') < line('$') |