How to prevent display of /t whitespace characters in code reviews

Nov 17, 2011 at 8:00 PM

In my configuration of Malevich I've noticed that as code files are displayed in the browser, all of the \t tab characters present in sources to be reviewed are being presented on the screen. For example:

 t\tfor (UINT uIndex = 0; uIndex < 4; uIndex++)
533 \t\t{ 616 \t\t{
534 \t\t\tif ((uIndex == 0 && !(uTaskStatus & TASKINDEX_SESSIONLOCK))   ||  617 \t\t\tif ((uIndex == 0 && !(uTaskStatus & TASKINDEX_SESSIONLOCK))   || 
535 \t\t\t\t(uIndex == 1 && !(uTaskStatus & TASKINDEX_SESSIONUNLOCK)) ||  618 \t\t\t\t(uIndex == 1 && !(uTaskStatus & TASKINDEX_SESSIONUNLOCK)) || 
536 \t\t\t\t(uIndex == 2 && !(uTaskStatus & TASKINDEX_REMOTECONNECT)) ||  619 \t\t\t\t(uIndex == 2 && !(uTaskStatus & TASKINDEX_REMOTECONNECT)) || 
537 \t\t\t\t(uIndex == 3 && !(uTaskStatus & TASKINDEX_REMOTEDISCONNECT))) 620 \t\t\t\t(uIndex == 3 && !(uTaskStatus & TASKINDEX_REMOTEDISCONNECT)))
538 \t\t\t{ 621 \t\t\t{
539 \t\t\t\t_stprintf_s(szTaskXMLName, _countof(szTaskXMLName),  622 \t\t\t\t_stprintf_s(szTaskXMLName, _countof(szTaskXMLName), 
540 \t\t\t\t\t_T("%s%s.XML"),  623 \t\t\t\t\t_T("%s%s.XML"), 
541 \t\t\t\t\tpszAltXMLPath ? pszAltXMLPath : USERDOMAINNETLOGONPATH, szTaskNameList[uIndex]); 624 \t\t\t\t\tpszAltXMLPath ? pszAltXMLPath : USERDOMAINNETLOGONPATH, szTaskNameList[uIndex]);

This kind of kills readability for performing code reviews. In looking through the screenshots on this project, I don't see this behavior in the examples. So I'm guessing this isn't normal. Is there a setting or configuration I should investigate to correct this behavior?

Coordinator
Nov 17, 2011 at 8:32 PM

Yes of course there is a way :-). Take a look at spacesPerTab property in web.config. It is -1 by default (show tabs) because majority of people prohibit tabs in their code and this setting makes stray tabs very visible. But if you do allow them, it's supported as well.

Nov 17, 2011 at 8:35 PM

Yep. I just discovered this setting myself in web.config a few moments before your reply.

I also take your point about why you default this way (many people follow a practice prohibiting tabs...). It's worth considering.

Thanks for the quick responses!