Handle wrapping of empty braces in a better way
This commit is contained in:
parent
4bc6e8623a
commit
e111ac083a
@ -108,12 +108,15 @@ function! argwrap#trimArgument(text)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! argwrap#extractContainerArgs(text)
|
function! argwrap#extractContainerArgs(text)
|
||||||
|
let l:text = substitute(a:text, '^\s*\(.\{-}\)\s*$', '\1', '')
|
||||||
|
|
||||||
let l:stack = []
|
let l:stack = []
|
||||||
let l:arguments = []
|
let l:arguments = []
|
||||||
let l:argument = ''
|
let l:argument = ''
|
||||||
|
|
||||||
for l:index in range(strlen(a:text))
|
if len(l:text) > 0
|
||||||
let l:char = a:text[l:index]
|
for l:index in range(strlen(l:text))
|
||||||
|
let l:char = l:text[l:index]
|
||||||
call argwrap#updateScope(l:stack, l:char)
|
call argwrap#updateScope(l:stack, l:char)
|
||||||
|
|
||||||
if len(l:stack) == 0 && l:char == ','
|
if len(l:stack) == 0 && l:char == ','
|
||||||
@ -125,6 +128,8 @@ function! argwrap#extractContainerArgs(text)
|
|||||||
endfor
|
endfor
|
||||||
|
|
||||||
call add(l:arguments, argwrap#trimArgument(l:argument))
|
call add(l:arguments, argwrap#trimArgument(l:argument))
|
||||||
|
endif
|
||||||
|
|
||||||
return l:arguments
|
return l:arguments
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user