diff --git a/argwrap.vim b/argwrap.vim index a0bd1fd..52d10a3 100644 --- a/argwrap.vim +++ b/argwrap.vim @@ -104,9 +104,7 @@ function! argwrap#updateScope(stack, char) endfunction function! argwrap#trimArgument(text) - let l:stripped = substitute(a:text, "\\s\\+", "", "") - let l:stripped = substitute(l:stripped, "^\\s\\+", "", "") - return l:stripped + return substitute(a:text, '^\s*\(.\{-}\)\s*$', '\1', '') endfunction function! argwrap#extractArguments(text) diff --git a/sample.txt b/sample.txt index 146209f..69d2427 100644 --- a/sample.txt +++ b/sample.txt @@ -1,12 +1,16 @@ - a = Foo("a": 4, "z": 2, [b, z], "hello, world", c) + a = Foo( + "a": 4, + "z": 2, + [b, z], + "hello, world", + c + ) + +Foo(a b, c d) Foo(a, b) -Foo( - a, - [b, c], - d -) +Foo(a, [b, [2, 3] c], d) Foo( a,