mirror of
https://github.com/amix/vimrc
synced 2025-06-16 09:35:01 +08:00
Updated plugins
This commit is contained in:
@ -38,6 +38,7 @@ additional contributions from:
|
||||
* [r00k](https://github.com/r00k)
|
||||
* [radicalbit](https://github.com/radicalbit)
|
||||
* [redpill](https://github.com/redpill)
|
||||
* [rglassett](http://github.com/rglassett)
|
||||
* [robhudson](https://github.com/robhudson)
|
||||
* [Shraymonks](https://github.com/shraymonks)
|
||||
* [sickill](https://github.com/sickill)
|
||||
|
@ -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
|
||||
|
@ -63,7 +63,7 @@ describe 'snippet parser'
|
||||
Expect Parse(printf('${1:%s}', text)) == [[1] + expect]
|
||||
end
|
||||
|
||||
it 'converts tabs according to &et, &sts, &sw'
|
||||
it 'converts tabs according to &et, &sts, &sw, &ts'
|
||||
" &noet -> leave tabs alone
|
||||
setl noet
|
||||
Expect Parse("abc\tdef\n\t\tghi") == ["abc\tdef", "\t\tghi"]
|
||||
@ -77,6 +77,12 @@ describe 'snippet parser'
|
||||
|
||||
setl et sts=-1 sw=3
|
||||
Expect Parse("abc\tdef\n\t\tghi") == ["abc def", " ghi"]
|
||||
|
||||
" See #227
|
||||
if exists('*shiftwidth')
|
||||
setl et sts=0 sw=0 ts=3
|
||||
Expect Parse("abc\tdef\n\t\tghi") == ["abc def", " ghi"]
|
||||
endif
|
||||
end
|
||||
|
||||
it 'parses backslashes as escaping the next character or joining lines'
|
||||
|
Reference in New Issue
Block a user