nix-community / vscode-nix-ide

Nix language support for VSCode editor [maintainer: @jnoortheen]
https://marketplace.visualstudio.com/items?itemName=jnoortheen.nix-ide
MIT License
310 stars 23 forks source link

Support `reindentselectedlines` #392

Open musjj opened 6 months ago

musjj commented 6 months ago

https://github.com/VSCodeVim/Vim/issues/1017#issuecomment-738170269

Indentation after both o (editor.action.insertLineAfter) and cc (editor.action.reindentselectedlines) is determined by the language support, but they're specified differently, so some language plugins support the former better than the latter. Maybe some supports the latter better than the former, but none that I've found.

I write C++ and python for my job and o works great while cc doesn't in both of these. Typescript and rust, however, both work as expected.

The issue can be reproduced with the Vim plugin by putting the cursor in an empty line like this:

{
█
}

Then pressing cc in normal mode. It should auto-indent, but it does nothing currently. o works perfectly, on the other hand.