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
if l:extractStart < l:extractEnd
let l:extract = 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
let l:text .= l:lineText[l:extractStart : l:extractEnd - 1]
endif
endfor
@ -104,7 +101,8 @@ function! argwrap#updateScope(stack, char)
endfunction
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
function! argwrap#extractContainerArgs(text)