Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio HTML formatter: Hitting enter removes all indents in the previous line

Running Visual Studio Community 2015 (but have seen the problem in earlier versions as well), and when I'm editing an HTML-file, when I hit enter to go to the next line, the line I just left is moved to the left, removing the indents. Ctrl-K,D reformats the line again. Pretty annoying?

Before enter:

Before enter

After enter:

enter image description here

Identing is set to Smart in Text Editor|HTML|Tabs as well as Text Editor|HTML (Web Forms)|Tabs

Seems like a bug, why would anyone need that behaviour?

like image 511
SvendK Avatar asked Dec 25 '22 05:12

SvendK


1 Answers

Solution:

It just hit me: ReSharper? And yes, I tried suspending ReSharper in Options|ReSharper and the weird behaviour went away.

After some trial'n'error, I found the option: ReSharper|Options and Code Editing|HTML|Formatting Style|Do not indent children of.

Apparently ReSharper don't want children of the body tag to be indented. I don't agree. Removed "body" from the setting, and all is bliss now.

enter image description here

like image 166
SvendK Avatar answered May 16 '23 09:05

SvendK