When wrapping, move to first line inside container.

This (in combination with previous patch) allows for seamless back-and-forth toggling between wrapped and
unwrapped states.
This commit is contained in:
Jeet Sukumaran 2018-05-26 11:08:07 -04:00
parent 30edd6ba0a
commit 2ca601e10b

View File

@ -257,6 +257,7 @@ function! argwrap#toggle()
let l:container = argwrap#extractContainer(l:range) let l:container = argwrap#extractContainer(l:range)
if l:range.lineStart == l:range.lineEnd if l:range.lineStart == l:range.lineEnd
call argwrap#wrapContainer(l:range, l:container, l:arguments, l:wrapBrace, l:tailComma, l:tailCommaBraces, l:tailIndentBraces, l:linePrefix, l:commaFirst, l:commaFirstIndent) call argwrap#wrapContainer(l:range, l:container, l:arguments, l:wrapBrace, l:tailComma, l:tailCommaBraces, l:tailIndentBraces, l:linePrefix, l:commaFirst, l:commaFirstIndent)
let l:cursor[1] = l:range.lineStart + 1
else else
call argwrap#unwrapContainer(l:range, l:container, l:arguments, l:padded) call argwrap#unwrapContainer(l:range, l:container, l:arguments, l:padded)
let l:cursor[1] = l:range.lineStart let l:cursor[1] = l:range.lineStart