[Question] How to properly indent a linewise surrounded block?
Hi! After searching through the issue tracker for a bit, I've found a way to re-indent the inner block after a linewise surround, with 'command': ["'[,']normal! =="]:
let g:sandwich#recipes += [{'buns': ['for () {', '}'], 'input': ['bf'], 'linewise': 1, 'command': ["'[,']normal! =="]}]
However, this has a problem. If you try to add the cursor option, the command changes the last positioning of the cursor. For example, executing this recipe:
let g:sandwich#recipes += [{'buns': ['for () {', '}'], 'input': ['bf'], 'linewise': 1, 'command': ["'[,']normal! =="], 'cursor': 'head'}]
leaves the cursor at the end of the block, even though 'cursor': 'head' was specified. I imagine this happens because the command changed the cursor position.
Is there a way to indent the inner block, which doesn't break the cursor option?
Thank you for your report. This is probably a bug, but I'm not sure there could be a good solution. Anyway, I will try to fix it.