Skip to content

Commit 3dd9d32

Browse files
authored
Fix minor mistake related to $length
1 parent 83f5723 commit 3dd9d32

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Tokenizers/Tokenizer.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -642,9 +642,10 @@ public function replaceTabsInToken(&$token, $prefix=' ', $padding=' ', $tabWidth
642642
$tabNum++;
643643

644644
// Move the pointer to the next tab stop.
645-
$length = $tabWidth - ($currColumn + $tabWidth - 1) % $tabWidth;
646-
$currColumn += $length;
647-
$newContent .= $prefix.str_repeat($padding, ($length - 1));
645+
$pad = $tabWidth - ($currColumn + $tabWidth - 1) % $tabWidth;
646+
$currColumn += $pad;
647+
$length += $pad;
648+
$newContent .= $prefix.str_repeat($padding, ($pad - 1));
648649
}//end foreach
649650
}//end if
650651

0 commit comments

Comments
 (0)