Changeset View
Changeset View
Standalone View
Standalone View
src/lint/renderer/ArcanistConsoleLintRenderer.php
Show First 20 Lines • Show All 140 Lines • ▼ Show 20 Lines | if ($message->isPatchable()) { | ||||
// changed character range to make it easier to pick out. | // changed character range to make it easier to pick out. | ||||
if ($old_impact === 1 && $new_impact === 1) { | if ($old_impact === 1 && $new_impact === 1) { | ||||
$old_lines[$start - 1] = substr_replace( | $old_lines[$start - 1] = substr_replace( | ||||
$old_lines[$start - 1], | $old_lines[$start - 1], | ||||
$this->highlightText($original), | $this->highlightText($original), | ||||
$char - 1, | $char - 1, | ||||
strlen($original)); | strlen($original)); | ||||
// See T13543. The message may have completely removed this line: for | |||||
// example, if it trimmed trailing spaces from the end of a file. If | |||||
// the line no longer exists, don't try to highlight it. | |||||
if (isset($new_lines[$start - 1])) { | |||||
$new_lines[$start - 1] = substr_replace( | $new_lines[$start - 1] = substr_replace( | ||||
$new_lines[$start - 1], | $new_lines[$start - 1], | ||||
$this->highlightText($replacement), | $this->highlightText($replacement), | ||||
$char - 1, | $char - 1, | ||||
strlen($replacement)); | strlen($replacement)); | ||||
} | } | ||||
} | |||||
// If lines at the beginning of the changed line range are actually the | // If lines at the beginning of the changed line range are actually the | ||||
// same, shrink the range. This happens when a patch just adds a line. | // same, shrink the range. This happens when a patch just adds a line. | ||||
do { | do { | ||||
$old_line = idx($old_lines, $start - 1, null); | $old_line = idx($old_lines, $start - 1, null); | ||||
$new_line = idx($new_lines, $start - 1, null); | $new_line = idx($new_lines, $start - 1, null); | ||||
if ($old_line !== $new_line) { | if ($old_line !== $new_line) { | ||||
▲ Show 20 Lines • Show All 181 Lines • Show Last 20 Lines |