Visual Studio 2015 - arbitrary cursor position on an empty line

Source note. I don't get any superuser answers to my question , so please let me ask about it here:

I inherited a VS solution with many unorthodox settings. I can’t destroy all these settings and start all over again. Thus, there is 1 setting that I want to change to VS by default, but cannot find it.

In a normal / standard VS C # environment, when you click on a line of code that has not yet been written (empty, without spaces, without code, without tabs), the cursor automatically positions the beginning where the line of code should begin. If it is inside the foreach, if, or, etc., It will retreat slightly from the left edge in accordance with the rules of tabulation, etc.

But in VS's weird settings, I have, wherever I am, the cursor position at that exact location. Therefore, if I click on col 20 of the next line, the cursor will remain on col 20, and will not automatically reposition to col 5 or wherever it is. This is so annoying because I can’t always see the eye where the cursor should be, and I end up clicking at the end of the previous line and then pressing ENTER, at which point it moves to the next line and positions the cursor in the right place.

How can i fix this?

+7
visual-studio visual-studio-2010 visual-studio-2012
source share
2 answers

It is controlled by the Enable virtual space option. See Visual Studio Options - Text Editor - C #. By default it is off / not installed.

+9
source share

I solved this problem by applying the change suggested by Sergey (Visual Studio settings β†’ Text editor β†’ C # β†’ Enable virtual space [check]), but it was also turned on (Options β†’ Text editor β†’ C # β†’ Tabs β†’ Smart).

0
source share

All Articles