1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 00:42:41 +01:00

Fix displaying gap context when showing first lines

Summary: Show First 20 Lines doesn't display gap context and emits error.

Test Plan: Showed first 20 lines, last 20 lines, middle 20 lines - saw context and no error.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3616
This commit is contained in:
vrana 2012-10-03 21:40:13 -07:00
parent a185b1b4a7
commit 58206a146f

View file

@ -1386,7 +1386,11 @@ final class DifferentialChangesetParser {
//
$depths = array();
$last_depth = 0;
for ($ii = $range_start + $range_len - 1; $ii >= $range_start; $ii--) {
$range_end = $range_start + $range_len;
if (!isset($this->new[$range_end])) {
$range_end--;
}
for ($ii = $range_end; $ii >= $range_start; $ii--) {
// We need to expand tabs to process mixed indenting and to round
// correctly later.
$line = str_replace("\t", " ", $this->new[$ii]['text']);