realigns to the tab size if a space is followed by a tab, this mimics the previous behaviour (nw)

This commit is contained in:
smf- 2012-10-08 14:17:55 +00:00
parent 1872876652
commit ae3a267781

View File

@ -216,18 +216,27 @@ int main(int argc, char *argv[])
{ {
int spaces = 1; int spaces = 1;
while (original[src]==32) while (original[src] == 0x20)
{ {
spaces++; spaces++;
src++; src++;
} }
/* Remove invisible spaces */
if (original[src] == 0x09)
{
int realign = (col + spaces) % tab_size;
removed_spaces += realign;
spaces -= realign;
}
col += spaces;
while (spaces > 0) while (spaces > 0)
{ {
modified[dst++] = 0x09; modified[dst++] = 0x09;
spaces -= tab_size; spaces -= tab_size;
added_tabs++; added_tabs++;
col += tab_size;
} }
} }