Skip to content

Commit 38fdcfa

Browse files
committed
Merge branch 'fix/str-expand-leading-tabs'
2 parents e409aa4 + ca7feae commit 38fdcfa

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/Toolkit/Utility/Str.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,7 @@ public static function expandLeadingTabs(
467467
foreach (array_chunk($lines, 2) as $i => [$line, $eol]) {
468468
if (!$i && $preserveLine1) {
469469
$expanded .= $line . $eol;
470+
$column = 1;
470471
continue;
471472
}
472473
$parts = explode("\t", $line);

tests/unit/Toolkit/Utility/StrTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -865,6 +865,13 @@ public static function expandLeadingTabsProvider(): array
865865
EOF,
866866
4,
867867
],
868+
[
869+
"/* the printed value would be\n \$i before the increment\n (post-increment) */",
870+
"/* the printed value would be\n\t\t \$i before the increment\n\t\t (post-increment) */",
871+
8,
872+
true,
873+
21,
874+
],
868875
];
869876
}
870877

0 commit comments

Comments
 (0)