From 5868d3205d43596c13227c27e125a901b054bd11 Mon Sep 17 00:00:00 2001 From: Matteo Landi Date: Wed, 12 Oct 2016 23:49:06 +0200 Subject: [PATCH] Use the last char of container.prefix as match expression --- autoload/argwrap.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/autoload/argwrap.vim b/autoload/argwrap.vim index f7cd41c..f5d2a7a 100644 --- a/autoload/argwrap.vim +++ b/autoload/argwrap.vim @@ -159,6 +159,7 @@ endfunction function! argwrap#wrapContainer(range, container, arguments, wrapBrace, tailComma, tailCommaBraces, linePrefix, commaFirst) let l:argCount = len(a:arguments) let l:line = a:range.lineStart + let l:prefix = a:container.prefix[len(a:container.prefix) - 1] call setline(l:line, a:container.indent . a:container.prefix) @@ -175,7 +176,7 @@ function! argwrap#wrapContainer(range, container, arguments, wrapBrace, tailComm let l:text .= a:arguments[l:index] else let l:text .= a:container.indent . a:linePrefix . a:arguments[l:index] - if !l:last || a:tailComma || a:tailCommaBraces =~ a:container.prefix + if !l:last || a:tailComma || a:tailCommaBraces =~ l:prefix let l:text .= ',' end end