j-zeppenfeld / tab-indent-space-align

A Visual Studio Code extension for those who know the difference between indentation and alignment.
MIT License
17 stars 1 forks source link

Changing indent of aligned lines loses alignment #8

Closed Nucaranlaeg closed 7 months ago

Nucaranlaeg commented 7 months ago

When I have code like

function foo(array){
[TAB]array.map(a=>a[0])
[TAB]     .filter(a=>a);
}

I can change indentation by selecting one or more lines and pressing CTRL+]. Unfortunately, during this process the alignment spaces are converted into tabs rather than preserved.

j-zeppenfeld commented 7 months ago

This plugin only registers key bindings for TAB (Alignment Preserving Indent), SHIFT+TAB (Alignment Preserving Outdent) and ENTER (Alignment Preserving Newline). If you would like CTRL+] and CTRL+[ to preserve alignment as well, you can change those key bindings to perform the alignment preserving commands mentioned above rather than the default commands provided by the editor.

Please let me know if that works for you, as I would prefer keeping the number of key bindings registered by this plugin to a minimum.

Nucaranlaeg commented 7 months ago

That does fix it, thanks! I guess I just assumed that it would set those immediately.