From cfe10c45a8171a471340b055950bb7980d8ecb25 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Thu, 19 May 2016 09:21:17 -0700 Subject: [PATCH] Fixing conflicting options #5 --- autoload/argwrap.vim | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/autoload/argwrap.vim b/autoload/argwrap.vim index ad80727..b5eb14f 100644 --- a/autoload/argwrap.vim +++ b/autoload/argwrap.vim @@ -163,12 +163,15 @@ function! argwrap#wrapContainer(range, container, arguments, wrapBrace, tailComm call setline(l:line, a:container.indent . a:container.prefix) for l:index in range(l:argCount) - let l:text = a:container.indent . a:linePrefix . a:arguments[l:index] - if l:index < l:argCount - 1 || a:tailComma + let l:text = a:container.indent . a:linePrefix . a:arguments[l:index] + let l:last = l:index == l:argCount - 1 + + if !l:last || a:tailComma let l:text .= ',' - elseif !a:wrapBrace + end + if l:last && !a:wrapBrace let l:text .= a:container.suffix - endif + end call append(l:line, l:text) let l:line += 1