Understanding Virtual Space

Menu:  Tools -> Options -> Text Editor -> All Languages -> General -> Settings
Versions:  2008,2010
Published:  2/28/2010
Code:  vstipEdit0023

 

image

 

Okay.  Virtual space is a little funky to understand if you aren't from the Old School.  You see, a loooooong time ago in this galaxy we used to have (and some people still have) editors that treat everywhere as editable space.  Let me explain:  Without virtual space on the line ends where the code ends.  Now you can have some really long lines of code but, until you press Enter, the line just keeps on going.  Like this:

image

 

If I move my cursor to the end of any of these lines and hit my Right Arrow key then it will go to the next line.  So, for the short line the cursor will jump down to the next line at column  44.  For the longer line it will jump down the next line at column 68.  And for the super duper long line it will jump to the next line at column 176.  This is the way editors have been for a while now and isn't really new to folks.

 

However, this way wasn't always the case.  There was a time when you could type anywhere you wanted any time you wanted without restriction.  Some text editors still do this today.  Virtual space allows you to go back to the old style of editing which is preferred by some coders.  Go to Tools -> Options -> Text Editor -> All Languages -> General -> Settings and check the "Enable virtual space" checkbox to turn this feature on.  When you do, you will be able to type anywhere on a line regardless of whether the code ends or not:

image