Use shiftwidth()
This commit is contained in:
parent
db82832526
commit
9749509840
@ -200,7 +200,7 @@ function! s:indent_snippet(begin, end) abort "{{{
|
|||||||
if &l:expandtab && current_line =~ '^\t\+'
|
if &l:expandtab && current_line =~ '^\t\+'
|
||||||
" Expand tab.
|
" Expand tab.
|
||||||
cal setline('.', substitute(current_line,
|
cal setline('.', substitute(current_line,
|
||||||
\ '^\t\+', base_indent . repeat(' ', &shiftwidth *
|
\ '^\t\+', base_indent . repeat(' ', shiftwidth() *
|
||||||
\ len(matchstr(current_line, '^\t\+'))), ''))
|
\ len(matchstr(current_line, '^\t\+'))), ''))
|
||||||
elseif line_nr != a:begin
|
elseif line_nr != a:begin
|
||||||
call setline('.', base_indent . current_line)
|
call setline('.', base_indent . current_line)
|
||||||
|
@ -48,7 +48,7 @@ function! SnippetsIndent() abort "{{{
|
|||||||
if prev_line =~ '^\s*$'
|
if prev_line =~ '^\s*$'
|
||||||
return 0
|
return 0
|
||||||
elseif prev_line =~ '^' . syntax && line !~ '^\s*' . syntax
|
elseif prev_line =~ '^' . syntax && line !~ '^\s*' . syntax
|
||||||
return &shiftwidth
|
return shiftwidth()
|
||||||
else
|
else
|
||||||
return match(line, '\S')
|
return match(line, '\S')
|
||||||
endif
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user