Skip to content

Commit 1a4d725

Browse files
committed
Fix first line highlighting logic. Should only be included when files have been touched
1 parent e31b7ce commit 1a4d725

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/Git/LineFilter.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,16 @@ public function setFirstLineAlwaysTouched($firstLineAlwaysTouched)
5858
*/
5959
private function lineWasTouched(RelativeFile $file, $line)
6060
{
61-
if ($line === 1 && $this->firstLineAlwaysTouched) {
62-
return true;
63-
}
64-
6561
$filePath = $file->getPath();
6662
if (!key_exists($filePath, $this->modifiedFiles)) {
6763
return false;
6864
}
6965

66+
// File must have been touched to have the first line highlighted
67+
if ($line === 1 && $this->firstLineAlwaysTouched) {
68+
return true;
69+
}
70+
7071
if ($this->branchModifications->isNewFile($file)) {
7172
return true;
7273
}

0 commit comments

Comments
 (0)