1
0
mirror of https://github.com/amix/vimrc synced 2025-07-02 05:05:00 +08:00

Updated plugins

This commit is contained in:
Amir
2024-10-06 10:25:50 +02:00
parent ee7e062909
commit 46294d589d
202 changed files with 306918 additions and 203617 deletions

View File

@ -74,8 +74,15 @@ describe 'snippet state'
Expect b:snip_state.stop_no == 3
end
it 'does something at the ends'
"
it 'wraps around when going before the first or after the last stop'
let b:snip_state.stops = { 0 : {}, 1 : {}, 2 : {}, 3 : {} }
let b:snip_state.stop_count = 4
let b:snip_state.stop_no = 3
call b:snip_state.find_next_stop(0)
Expect b:snip_state.stop_no == 1
let b:snip_state.stop_no = 1
call b:snip_state.find_next_stop(1)
Expect b:snip_state.stop_no == 3
end
end

View File

@ -1,6 +1,9 @@
describe 'snippet parser'
before
" two optional arguments:
" first one: whether or not to create the stop stubs
" second one: whether or not to return the stops
function! Parse(snippet, ...)
let [snip, stops] = snipmate#parse#snippet(a:snippet, (a:0 ? a:1 : 1))
return (a:0 > 1 && a:2) ? [snip, stops] : snip
@ -149,4 +152,19 @@ describe 'snippet parser'
Expect Parse("foo\n\nbar") == [['foo'], [''], ['bar']]
end
it 'parses a selection as a special var named "select" with each item'
Expect Parse("${1|foo|bar|baz|select}") ==
\ [[[1, ['select', 'foo', 'bar', 'baz', 'select']]]]
end
it 'stores selection items in the var dictionary'
let [snip, stops] = Parse("${1|foo|bar|baz|select}", 0, 1)
Expect stops[1].items == ['foo', 'bar', 'baz', 'select']
end
it 'sets a selections placeholder to the first item'
let [snip, stops] = Parse("${1|foo|bar|baz|select}", 0, 1)
Expect stops[1].placeholder == 'foo'
end
end