Here's a gif of what's happening. I am pressing Enter twice. I don't want the indentation that gets created after I press Enter the second time.
EDIT: To be more precise, I do want to keep smart indentation to match newline indentation to the current block, even when new blocks are created. What I don't understand/like is the way it is adding indentation when that block was not ever indented that far to begin with. So I don't want Visual Studio to relatively indent newlines; it's not like I want to remove automatic indentation entirely.
Visual studio's smart indenting does automatically indenting, but we can select a block or all the code for indentation. Use either of the two ways to indentation the code: Shift + Tab , Ctrl + k + f .
The solution was to go to 'Tools > Options > Text Editor > Basic > VB Specific' and turn 'Pretty Listing' OFF.
Tools - Options - Text Editor - C# - Tabs - Indenting
Set the value to None
from Smart
. Bear in mind this will drop your indentation to the start of the line, no tabs or spaces until you place them in yourself. This can cause headaches in the long run having to indent yourself, so you can just disable it once you move on and go back to you automated indentation.
It's not perfect, and according to everyone that uses visual studio you aren't alone in your complaints of indentation.
Please see this question if you want to know what I mean. Very messy.
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