Handle wrapping of empty braces in a better way

This commit is contained in:
Alex Yatskov 2015-03-26 18:28:22 +09:00
parent 4bc6e8623a
commit e111ac083a

View File

@ -108,12 +108,15 @@ function! argwrap#trimArgument(text)
endfunction
function! argwrap#extractContainerArgs(text)
let l:text = substitute(a:text, '^\s*\(.\{-}\)\s*$', '\1', '')
let l:stack = []
let l:arguments = []
let l:argument = ''
for l:index in range(strlen(a:text))
let l:char = a:text[l:index]
if len(l:text) > 0
for l:index in range(strlen(l:text))
let l:char = l:text[l:index]
call argwrap#updateScope(l:stack, l:char)
if len(l:stack) == 0 && l:char == ','
@ -125,6 +128,8 @@ function! argwrap#extractContainerArgs(text)
endfor
call add(l:arguments, argwrap#trimArgument(l:argument))
endif
return l:arguments
endfunction