Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/parser/DifferentialChangesetParser.php
| Show First 20 Lines • Show All 1,047 Lines • ▼ Show 20 Lines | if ($this->comments) { | ||||
| if (isset($new['line']) && isset($new_mask[$new['line']])) { | if (isset($new['line']) && isset($new_mask[$new['line']])) { | ||||
| $feedback_mask[$ii] = true; | $feedback_mask[$ii] = true; | ||||
| } | } | ||||
| } | } | ||||
| $this->comments = id(new PHUIDiffInlineThreader()) | $this->comments = id(new PHUIDiffInlineThreader()) | ||||
| ->reorderAndThreadCommments($this->comments); | ->reorderAndThreadCommments($this->comments); | ||||
| $old_max_display = 1; | |||||
| foreach ($this->old as $old) { | |||||
| if (isset($old['line'])) { | |||||
| $old_max_display = $old['line']; | |||||
| } | |||||
| } | |||||
| $new_max_display = 1; | |||||
| foreach ($this->new as $new) { | |||||
| if (isset($new['line'])) { | |||||
| $new_max_display = $new['line']; | |||||
| } | |||||
| } | |||||
| foreach ($this->comments as $comment) { | foreach ($this->comments as $comment) { | ||||
| $final = $comment->getLineNumber() + | $display_line = $comment->getLineNumber() + $comment->getLineLength(); | ||||
| $comment->getLineLength(); | $display_line = max(1, $display_line); | ||||
| $final = max(1, $final); | |||||
| if ($this->isCommentOnRightSideWhenDisplayed($comment)) { | if ($this->isCommentOnRightSideWhenDisplayed($comment)) { | ||||
| $new_comments[$final][] = $comment; | $display_line = min($new_max_display, $display_line); | ||||
| $new_comments[$display_line][] = $comment; | |||||
| } else { | } else { | ||||
| $old_comments[$final][] = $comment; | $display_line = min($old_max_display, $display_line); | ||||
| $old_comments[$display_line][] = $comment; | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| $renderer | $renderer | ||||
| ->setOldComments($old_comments) | ->setOldComments($old_comments) | ||||
| ->setNewComments($new_comments); | ->setNewComments($new_comments); | ||||
| ▲ Show 20 Lines • Show All 888 Lines • Show Last 20 Lines | |||||