This commit is contained in:
Alex Yatskov 2014-12-01 20:10:17 +09:00
parent ac53632892
commit 84c43333b5
2 changed files with 17 additions and 18 deletions

View File

@ -96,10 +96,17 @@ function! argwrap#extractContainer(range)
endfunction endfunction
function! argwrap#wrapContainer(range, container, arguments) function! argwrap#wrapContainer(range, container, arguments)
let l:argCount = len(a:arguments)
let l:line = a:range.lineStart let l:line = a:range.lineStart
call setline(l:line, a:container.prefix) call setline(l:line, a:container.prefix)
for l:argument in a:arguments for l:index in range(l:argCount)
call append(l:line, l:argument . ",") let l:text = a:arguments[l:index]
if l:index < l:argCount - 1
let l:text .= ","
endif
call append(l:line, l:text)
let l:line += 1 let l:line += 1
exec printf("%s>", l:line) exec printf("%s>", l:line)
endfor endfor

View File

@ -1,16 +1,15 @@
a = Foo(a, [b, z], "hello, world", c, ) a = Foo(a, [b, z], "hello, world", c)
Foo(a, b)
Foo( Foo(
a, a,
[b, c], b
d
) )
Foo(a, [b, c], d)
Foo( Foo(
a a,
[b, "c"] [b, "c"],
d d
) )
@ -20,11 +19,4 @@ Foo(
d d
) )
Foo( Foo(a, [b, c], d)
a,
[
b,
c
],
d
)