mirror of
https://github.com/amix/vimrc
synced 2025-06-16 01:25:00 +08:00
Updated plugins
This commit is contained in:
@ -61,7 +61,7 @@ function! snipmate#legacy#process_snippet(snip) abort
|
||||
endw
|
||||
|
||||
if &et " Expand tabs to spaces if 'expandtab' is set.
|
||||
return substitute(snippet, '\t', repeat(' ', (&sts > 0) ? &sts : &sw), 'g')
|
||||
return substitute(snippet, '\t', repeat(' ', snipmate#util#tabwidth()), 'g')
|
||||
endif
|
||||
return snippet
|
||||
endfunction
|
||||
|
@ -187,7 +187,7 @@ call extend(s:parser_proto, snipmate#util#add_methods(s:sfile(), 'parser',
|
||||
|
||||
function! s:indent(count) abort
|
||||
if &expandtab
|
||||
let shift = repeat(' ', (&sts > 0) ? &sts : &sw)
|
||||
let shift = repeat(' ', snipmate#util#tabwidth())
|
||||
else
|
||||
let shift = "\t"
|
||||
endif
|
||||
|
@ -20,3 +20,11 @@ function! snipmate#util#eval(arg)
|
||||
endtry
|
||||
return type(ret) == type('') ? ret : string(ret)
|
||||
endfunction
|
||||
|
||||
function! snipmate#util#tabwidth()
|
||||
if &sts > 0
|
||||
return &sts
|
||||
else
|
||||
return exists('*shiftwidth') ? shiftwidth() : &sw
|
||||
endif
|
||||
endfunction
|
||||
|
Reference in New Issue
Block a user