1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2025-01-10 23:01:04 +01:00

Fix intraline lint patch rendering

Summary: `,` -> `, ` is currently highlighted wrong.

Test Plan:
Looked at patches of these errors:

- License linter
- `0+0`
- `0,0`

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D5093
This commit is contained in:
vrana 2013-02-22 16:55:22 -08:00
parent 21a4574922
commit 8ec038291a

View file

@ -138,7 +138,9 @@ final class ArcanistLintConsoleRenderer extends ArcanistLintRenderer {
$text_lines = explode("\n", $text);
$text_length = count($text_lines);
if ($text) {
$intraline = ($text != '' || $start || !preg_match('/\n$/', $patch));
if ($intraline) {
for (; $cursor < $line_num + $text_length; $cursor++) {
$chevron = ($cursor == $line_num);
// We may not have any data if, e.g., the old file does not exist.
@ -176,7 +178,7 @@ final class ArcanistLintConsoleRenderer extends ArcanistLintRenderer {
$patched = phutil_console_format('##%s##', $patch_line);
if ($text) {
if ($intraline) {
$patched = substr_replace(
$line_data[$line_num],
$patched,