From: Joshua Spence Date: Sun, 11 Jan 2015 19:49:14 +0000 (+1100) Subject: Fix a lint renderering issue X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=564dab098964aef59c5f7e22895247f2bad62879;p=arcanist.git Fix a lint renderering issue 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 --- diff --git a/src/lint/renderer/ArcanistConsoleLintRenderer.php b/src/lint/renderer/ArcanistConsoleLintRenderer.php index 25316c34..b1c32a51 100644 --- a/src/lint/renderer/ArcanistConsoleLintRenderer.php +++ b/src/lint/renderer/ArcanistConsoleLintRenderer.php @@ -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)); }