xsharp.eu • VS replaces tabs by spaces
Page 1 of 3

VS replaces tabs by spaces

Posted: Thu Jul 09, 2020 3:23 pm
by ic2
I often see that my tabs in VS like in front of comments change into spaces, e.g.

IF x==1 <tab><tab><tab><tab> // Here my comment
(All <tab> become groups of 4 spaces)

I switched
Text Editor > Advanced and "Use adaptive formatting off
and have Keep tabs, smart Indent set everywhere.

Reproducible: It (at least) ALWAYS happens when I copy a line (also in C#).

Is there any way to prevent this "space replacement"?

Dick

VS replaces tabs by spaces

Posted: Thu Jul 09, 2020 3:25 pm
by Chris
Hi Dick,

Is that on a regular prg file, or in a file associated with a form? I just now received a similar report for form related prg files, which I confirmed.

VS replaces tabs by spaces

Posted: Thu Jul 09, 2020 3:36 pm
by ic2
Hi Chris,

I always see it on regular code, like .prg or .cs files.

I've seen it mentioned in the Microsoft sites as well (also with "when will this ever be solved") but not so much lately. And as Robert didn't directly recognize it I thought I was maybe missing some setting (or at least: that's what I hope :)

Dick

VS replaces tabs by spaces

Posted: Thu Jul 09, 2020 3:47 pm
by Chris
Hi Dick,

That's strange, have never seen something like that. Can you please post a link to such a report about c#? Not seeing it myself in neither X# or c#, but this might give a hint on how to reproduce it.

VS replaces tabs by spaces

Posted: Thu Jul 09, 2020 4:05 pm
by ic2
Hello Chris,

https://developercommunity.visualstudio ... paces.html

Here it is posted with the Adaptive formatting (what where they thinking when they programmed this...) as solution, but that doesn't help.

https://developercommunity.visualstudio ... f-tab.html

Do you actually retain tabs when you copy and then paste a line ? For me all tabs are directly replaced with spaces in the pasted line.

Here's the search URL (5 pages with this problem)

https://developercommunity.visualstudio ... ad+of+tabs

Dick

VS replaces tabs by spaces

Posted: Thu Jul 09, 2020 5:01 pm
by Chris
Hi Dick,

Yeah, it works fine for me...maybe VS is trying to be nice to me to make me start using it :) :) :)

Seriously, I have never seen that... Does anybody else see this behavior guys? Any hint in order to reproduce it would be very much appreciated...

VS replaces tabs by spaces

Posted: Thu Jul 09, 2020 5:13 pm
by FFF
ic2 wrote:Do you actually retain tabs when you copy and then paste a line ? For me all tabs are directly replaced with spaces in the pasted line.
Hi Dick,
for you i started VS17, no customization at all, and tried on a simple winforms app. First, i have no clue, how to make whitespace visible, but i think one sees here, that my two starting tabs are retained.
Tab-Copy.gif
Tab-Copy.gif (72.73 KiB) Viewed 476 times
(OT: This "ScreenToGif" is a cool thing!)

VS replaces tabs by spaces

Posted: Thu Jul 09, 2020 5:36 pm
by ic2
Hello Karl, Chris,

That seems to work fine for you indeed Karl.But I've no idea what setting I have different.

Dick

VS replaces tabs by spaces

Posted: Thu Jul 09, 2020 5:48 pm
by Chris
FFF wrote: (OT: This "ScreenToGif" is a cool thing!)
Very cool indeed! Which app did you use?

VS replaces tabs by spaces

Posted: Thu Jul 09, 2020 6:45 pm
by FFF