mirror of
https://github.com/holub/mame
synced 2025-05-09 07:41:50 +03:00
realigns to the tab size if a space is followed by a tab, this mimics the previous behaviour (nw)
This commit is contained in:
parent
1872876652
commit
ae3a267781
@ -216,18 +216,27 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
int spaces = 1;
|
||||
|
||||
while (original[src]==32)
|
||||
while (original[src] == 0x20)
|
||||
{
|
||||
spaces++;
|
||||
src++;
|
||||
}
|
||||
|
||||
/* Remove invisible spaces */
|
||||
if (original[src] == 0x09)
|
||||
{
|
||||
int realign = (col + spaces) % tab_size;
|
||||
removed_spaces += realign;
|
||||
spaces -= realign;
|
||||
}
|
||||
|
||||
col += spaces;
|
||||
|
||||
while (spaces > 0)
|
||||
{
|
||||
modified[dst++] = 0x09;
|
||||
spaces -= tab_size;
|
||||
added_tabs++;
|
||||
col += tab_size;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user