From a8c9f2e8b09f08cf7e765f0b5e7a1489745b0391 Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 5 Mar 2015 14:04:21 -0800 Subject: [PATCH] Fix an issue where inlines appear in the wrong place in one-up views Summary: Ref T2009. Unchanged lines should always go above inlines; we get nonsense results otherwise. Test Plan: Inline now shows in correct place in unified view. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T2009 Differential Revision: https://secure.phabricator.com/D11987 --- .../render/DifferentialChangesetRenderer.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/applications/differential/render/DifferentialChangesetRenderer.php b/src/applications/differential/render/DifferentialChangesetRenderer.php index 09eb27ab47..0a52ab6e11 100644 --- a/src/applications/differential/render/DifferentialChangesetRenderer.php +++ b/src/applications/differential/render/DifferentialChangesetRenderer.php @@ -518,7 +518,14 @@ abstract class DifferentialChangesetRenderer { $out[] = $old_buf; $old_buf = array(); } - $new_buf[] = $primitive; + if (!$primitive['htype']) { + // If this line is the same in both versions of the file, put it in + // the old line buffer. This makes sure inlines on old, unchanged + // lines end up in the right place. + $old_buf[] = $primitive; + } else { + $new_buf[] = $primitive; + } } else if ($type == 'context' || $type == 'no-context') { $out[] = $old_buf; $out[] = $new_buf;