diff --git a/src/applications/paste/query/PhabricatorPasteSearchEngine.php b/src/applications/paste/query/PhabricatorPasteSearchEngine.php --- a/src/applications/paste/query/PhabricatorPasteSearchEngine.php +++ b/src/applications/paste/query/PhabricatorPasteSearchEngine.php @@ -13,6 +13,7 @@ public function newQuery() { return id(new PhabricatorPasteQuery()) + ->needContent(true) ->needSnippets(true); } @@ -166,7 +167,11 @@ $preview); $created = phabricator_datetime($paste->getDateCreated(), $viewer); - $line_count = count($lines); + // Get all of the file contents so we can correctly + // show the number of lines in the file since getSnippet + // limits the max number of lines to five. + $full_lines = phutil_split_lines($paste->getContent()); + $line_count = count($full_lines); $line_count = pht( '%s Line(s)', new PhutilNumber($line_count));