]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Fix a lint renderering issue
authorJoshua Spence <josh@joshuaspence.com>
Sun, 11 Jan 2015 19:49:14 +0000 (06:49 +1100)
committerJoshua Spence <josh@joshuaspence.com>
Sun, 11 Jan 2015 19:49:14 +0000 (06:49 +1100)
Summary: Currently there is an issue when renderering linter messages with `ArcanistConsoleLintRenderer` if `$message->getChar()` returns `0` (i.e. the value is unset).

Test Plan:
**Before**
{F265586}

**After**
{F265587}

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11319

src/lint/renderer/ArcanistConsoleLintRenderer.php

index 25316c34922b66d1a72cce0663092576b22cf9bb..b1c32a517dd30c834d6896ba3b7b2655d11ba7e0 100644 (file)
@@ -152,7 +152,7 @@ final class ArcanistConsoleLintRenderer extends ArcanistLintRenderer {
           $data = substr_replace(
             $data,
             phutil_console_format('##%s##', $text_line),
-            ($cursor == $line_num ? $start : 0),
+            ($cursor == $line_num ? ($start > 0 ? $start : null) : 0),
             strlen($text_line));
         }