Visual Studio making a mess of my code
Posted: Thu Oct 31, 2019 11:40 pm
I've seen this before and now Kees experienced the same. Without a reason/action (at lest none we realized) spaces in a program are replaced by tabs. I am not talking about indentation tabs. These get replaced by spaces in the copied content if you copy a line (one of the many reasons why I hate Visual Studio so much). So that's already bad enough. But VS can make it worse:
Here we see also that strings have tabs inside, e.g.
AddToLog("Program is already running - do not continue because the other program was still active: " + cLastLoggedDate+" "+cLastLoggedTime, True) // Log & stop
There are big gaps between the words in the string -which unfortunately is not visible in this forum (only when I edit it!) - these used to be 1 space and are now 1 tab!
Edit/Advanced, Untabify selected lines does nothing to reverse it (nor does Edit/Advanced, Tabify selection cause the problem).
I know how to reverse it (Edit/Find/replace, quick replace or Ctrl H, enter t (tab) in the Find box and click the .* button (Wildcard), space in the Replace box and then Alt A (second button after 2nd box). Then select all, Shft tab until everything is unindented, then Edit/Advanced, Format document - note that Format Selection doesn't work in X#) and then select all and Shift Tab twice because I don't like the way VS indents (it also indents all my methods between the End Class and End Namespace).
But my main question is: does anyone has an idea how VS created this mess?
Dick
Here we see also that strings have tabs inside, e.g.
AddToLog("Program is already running - do not continue because the other program was still active: " + cLastLoggedDate+" "+cLastLoggedTime, True) // Log & stop
There are big gaps between the words in the string -which unfortunately is not visible in this forum (only when I edit it!) - these used to be 1 space and are now 1 tab!
Edit/Advanced, Untabify selected lines does nothing to reverse it (nor does Edit/Advanced, Tabify selection cause the problem).
I know how to reverse it (Edit/Find/replace, quick replace or Ctrl H, enter t (tab) in the Find box and click the .* button (Wildcard), space in the Replace box and then Alt A (second button after 2nd box). Then select all, Shft tab until everything is unindented, then Edit/Advanced, Format document - note that Format Selection doesn't work in X#) and then select all and Shift Tab twice because I don't like the way VS indents (it also indents all my methods between the End Class and End Namespace).
But my main question is: does anyone has an idea how VS created this mess?
Dick