Back out spaces to TABs replace removing for COLORLS

Rewrite corresponding comment to say what happens in reality with oxtabs
and current terminal column.
This commit is contained in:
Andrey A. Chernov 2000-06-06 12:10:07 +00:00
parent aaf8e08205
commit 6cd5adff75
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=61334

View File

@ -241,6 +241,19 @@ printcol(dp)
dp->s_block);
if ((base += numrows) >= num)
break;
#ifdef COLORLS
/*
* We can't put tabs and color sequences together:
* column number will be incremented incorrectly
* for "stty oxtabs" mode.
*/
if (f_color)
while ((cnt = (chcnt + 1)) <= endcol) {
(void)putchar(' ');
chcnt = cnt;
}
else
#endif
while ((cnt = ((chcnt + tabwidth) & ~(tabwidth - 1)))
<= endcol){
(void)putchar(f_notabs ? ' ' : '\t');