Jan Elznic
Jan Elznic

Reputation: 195

Manually indent needed again when HTML tag is closed in VS Code

In Microsoft VS Code when I'm closing HTML tag (e.g. on bottom image), current position will be moved to the first column and remove tabs indent. Then I need to indent manually with tabs again. How can I fix it?

GIF Example - please click here…

My settings.json file:

...
"editor.detectIndentation": false,
"editor.wrappingIndent": "none",
"editor.trimAutoWhitespace": false,
"files.trimTrailingWhitespace": false,
"files.insertFinalNewline": true,
"html.format.endWithNewline": false,
...

Upvotes: 4

Views: 2238

Answers (2)

Jan Elznic
Jan Elznic

Reputation: 195

I set the options in settings.json to:


    "editor.detectIndentation": true,
    "editor.autoIndent": false

And it's working now. Fixed.

Upvotes: 9

ifconfig
ifconfig

Reputation: 6832

In your settings.json, "editor.detectIndentation": false, is your issue. Make that true.

i.e.

...
"editor.detectIndentation": true,
"editor.wrappingIndent": "none",
"editor.trimAutoWhitespace": false,
"files.trimTrailingWhitespace": false,
"files.insertFinalNewline": true,
"html.format.endWithNewline": false,
...

Upvotes: 2

Related Questions