From a25bb6ad769549b70e05e8656ad157e1734bcb40 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Thu, 19 Feb 2015 13:00:02 +0900 Subject: [PATCH] Trimming spaces when unwrapping dictionary definitions. --- autoload/argwrap.vim | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/autoload/argwrap.vim b/autoload/argwrap.vim index 261c217..dbdcb21 100644 --- a/autoload/argwrap.vim +++ b/autoload/argwrap.vim @@ -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)