Trimming spaces when unwrapping dictionary definitions.

This commit is contained in:
Alex Yatskov 2015-02-19 13:00:02 +09:00
parent 7ed22d6602
commit a25bb6ad76

View File

@ -82,10 +82,7 @@ function! argwrap#extractContainerArgText(range)
endif endif
if l:extractStart < l:extractEnd if l:extractStart < l:extractEnd
let l:extract = l:lineText[l:extractStart : l:extractEnd - 1] let l:text .= l:lineText[l:extractStart : l:extractEnd - 1]
let l:extract = substitute(l:extract, '^\s\+', '', 'g')
let l:extract = substitute(l:extract, ',$', ', ', 'g')
let l:text .= l:extract
endif endif
endfor endfor
@ -104,7 +101,8 @@ function! argwrap#updateScope(stack, char)
endfunction endfunction
function! argwrap#trimArgument(text) function! argwrap#trimArgument(text)
return substitute(a:text, '^\s*\(.\{-}\)\s*$', '\1', '') let l:trim = substitute(a:text, '^\s*\(.\{-}\)\s*$', '\1', '')
return substitute(l:trim, '\([:=]\)\s\{2,}', '\1 ', '')
endfunction endfunction
function! argwrap#extractContainerArgs(text) function! argwrap#extractContainerArgs(text)