I have an old code base that uses a weird indentation style. It uses tab width 8, but indents 4 notches, replacing 8 spaces by tabs where possible.
Code should look like this:
____if (foo) {
TAB---->if (bar) {
TAB---->____something();
TAB---->}
____}
I have installed the EditorConfig for Visual Studio Code extension and my .editorconfig
has this:
root = true
[*]
insert_final_newline = true
indent_size = 4
tab_width = 8
But the existing code looks like this:
____if (foo) {
TAB>if (bar) {
TAB>____something();
TAB>}
____}
When I add indent_style = tab
, the existing code looks correct again, but when I type new code, I get this:
____if (foo) { // after hitting Enter on this line the next line is indented too far:
TAB---->____something
____}
How can I achieve the desired display and indentation behavior?
This is a bug / missing feature in VSCode itself: https://github.com/microsoft/vscode/issues/10339
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With