Bugfixes
This commit is contained in:
parent
ac53632892
commit
84c43333b5
13
argwrap.vim
13
argwrap.vim
@ -96,10 +96,17 @@ function! argwrap#extractContainer(range)
|
||||
endfunction
|
||||
|
||||
function! argwrap#wrapContainer(range, container, arguments)
|
||||
let l:line = a:range.lineStart
|
||||
let l:argCount = len(a:arguments)
|
||||
let l:line = a:range.lineStart
|
||||
|
||||
call setline(l:line, a:container.prefix)
|
||||
for l:argument in a:arguments
|
||||
call append(l:line, l:argument . ",")
|
||||
for l:index in range(l:argCount)
|
||||
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
|
||||
exec printf("%s>", l:line)
|
||||
endfor
|
||||
|
22
sample.txt
22
sample.txt
@ -1,16 +1,15 @@
|
||||
a = Foo(a, [b, z], "hello, world", c, )
|
||||
|
||||
Foo(a, b)
|
||||
a = Foo(a, [b, z], "hello, world", c)
|
||||
|
||||
Foo(
|
||||
a,
|
||||
[b, c],
|
||||
d
|
||||
b
|
||||
)
|
||||
|
||||
Foo(a, [b, c], d)
|
||||
|
||||
Foo(
|
||||
a
|
||||
[b, "c"]
|
||||
a,
|
||||
[b, "c"],
|
||||
d
|
||||
)
|
||||
|
||||
@ -20,11 +19,4 @@ Foo(
|
||||
d
|
||||
)
|
||||
|
||||
Foo(
|
||||
a,
|
||||
[
|
||||
b,
|
||||
c
|
||||
],
|
||||
d
|
||||
)
|
||||
Foo(a, [b, c], d)
|
||||
|
Loading…
Reference in New Issue
Block a user