1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-26 08:42:40 +01:00

Initialize used variable in lint console renderer

This commit is contained in:
vrana 2013-02-25 16:23:27 -08:00
parent 9d92253903
commit 2464f54ecf

View file

@ -89,9 +89,9 @@ final class ArcanistLintConsoleRenderer extends ArcanistLintRenderer {
} }
$text = $message->getOriginalText(); $text = $message->getOriginalText();
$start = $message->getChar() - 1;
// Refine original and replacement text to eliminate start and end in common // Refine original and replacement text to eliminate start and end in common
if ($message->isPatchable()) { if ($message->isPatchable()) {
$start = $message->getChar() - 1;
$patch = $message->getReplacementText(); $patch = $message->getReplacementText();
$text_strlen = strlen($text); $text_strlen = strlen($text);
$patch_strlen = strlen($patch); $patch_strlen = strlen($patch);
@ -152,9 +152,7 @@ final class ArcanistLintConsoleRenderer extends ArcanistLintRenderer {
$data = substr_replace( $data = substr_replace(
$data, $data,
phutil_console_format('##%s##', $text_line), phutil_console_format('##%s##', $text_line),
($cursor == $line_num) ($cursor == $line_num ? $start : 0),
? ($message->isPatchable() ? $start : $message->getChar() - 1)
: 0,
strlen($text_line)); strlen($text_line));
} }