1
0
mirror of https://github.com/amix/vimrc synced 2025-06-16 09:35:01 +08:00

Updated plugins

This commit is contained in:
amix
2016-04-12 09:31:09 +01:00
parent ad875b0e0a
commit 5f6aa8fe09
54 changed files with 1236 additions and 291 deletions

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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'