Closed olmokramer closed 5 years ago
Thank you for your report. This is a bug.
I think it is reasonable to suppress autoformatting in a surrounding operation. I fix this problem soon.
Thanks for the quick reply!
I think it is reasonable to suppress autoformatting in a surrounding operation.
Yeah that's what I thought as well. You should probably also disable formatoptions=c
. Or were you planning on unsetting 'formatoptions'
altogether?
Yes, exactly. I think formatoptions
would be better to be empty in a operation.
I wrote the wrong number in the commit message... But, I think this is fixed by 558b858
. Could you update and test it?
That was fast! Seems to work yes, thanks!
The correct text is not sandwiched when any of the edits by vim-sandwich causes a reformatting due to the line being too long.
Reproducer:
$ vim
:setl fo+=t tw=10
(formatoptions is nowtcqn1j
for me)ab cd ef gh ij kl mn op
k
and thel
saiw(
The output is now
Note that the closing parenthesis is placed incorrectly.