aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYasuhiro Matsumoto <mattn.jp@gmail.com>2019-10-02 10:06:35 +0900
committerYasuhiro Matsumoto <mattn.jp@gmail.com>2019-10-02 10:06:35 +0900
commit7db10f422f61819a1a8f45d0dade1de17ecab2b6 (patch)
tree23618b619d03b4bd8ad16a14fb7ab20ded5648ba
parent31de6a5e48b65dface121e654e40e06de6bf364a (diff)
parent39cf197d0e46eeff8f905063ba5030e8690169b3 (diff)
downloadvim-sonictemplate-7db10f422f61819a1a8f45d0dade1de17ecab2b6.tar.gz
vim-sonictemplate-7db10f422f61819a1a8f45d0dade1de17ecab2b6.tar.bz2
vim-sonictemplate-7db10f422f61819a1a8f45d0dade1de17ecab2b6.zip
Merge branch 'master' of https://github.com/mattn/sonictemplate-vim
-rw-r--r--autoload/sonictemplate.vim10
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('$')