Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15444889
D21476.id51118.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D21476.id51118.diff
View Options
diff --git a/src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php b/src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php
--- a/src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php
+++ b/src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php
@@ -568,7 +568,24 @@
$parser->setRenderer($renderer);
- $diff_view = $parser->render(0, 0xFFFF, array());
+ // See PHI1896. If a user leaves an inline on a very long range with
+ // suggestions at the beginning and end, we'll hide context in the middle
+ // by default. We don't want to do this in the context of an inline
+ // suggestion, so build a mask to force display of all lines.
+
+ // (We don't know exactly how many lines the diff has, we just know that
+ // it can't have more lines than the old file plus the new file, so we're
+ // using that as an upper bound.)
+
+ $min = 0;
+
+ $old_len = count(phutil_split_lines($old_lines));
+ $new_len = count(phutil_split_lines($new_lines));
+ $max = ($old_len + $new_len);
+
+ $mask = array_fill($min, ($max - $min), true);
+
+ $diff_view = $parser->render($min, ($max - $min), $mask);
$view = phutil_tag(
'div',
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Mar 28, 11:43 AM (2 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7386673
Default Alt Text
D21476.id51118.diff (1 KB)
Attached To
Mode
D21476: Never render "Show More Context" inside an inline comment suggestion diff
Attached
Detach File
Event Timeline
Log In to Comment