Tweak some display behaviors for indent indicators

Summary:
Ref T13161.

  - Don't show ">>" when the line indentation changed but the text also changed, this is just "the line changed".
  - The indicator seems a little cleaner if we just reuse the existing "bright" colors, which already have colorblind colors anyway.

Test Plan: Got slightly better rendering for some diffs locally.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13161

Differential Revision: https://secure.phabricator.com/D20195
This commit is contained in:
epriestley
2019-02-19 14:39:08 -08:00
parent fe7047d12d
commit cf048f4402
4 changed files with 10 additions and 12 deletions

View File

@@ -199,10 +199,8 @@ final class CelerityDefaultPostprocessor
'diff.background' => '#fff',
'new-background' => 'rgba(151, 234, 151, .3)',
'new-bright' => 'rgba(151, 234, 151, .6)',
'new-background-strong' => 'rgba(151, 234, 151, 1)',
'old-background' => 'rgba(251, 175, 175, .3)',
'old-bright' => 'rgba(251, 175, 175, .7)',
'old-background-strong' => 'rgba(251, 175, 175, 1)',
'move-background' => '#fdf5d4',
'copy-background' => '#f1c40f',

View File

@@ -288,7 +288,7 @@ final class DifferentialHunkParser extends Phobject {
$o_text = $o['text'];
$n_text = $n['text'];
if ($o_text !== $n_text) {
if ($o_text !== $n_text && (ltrim($o_text) === ltrim($n_text))) {
$o_depth = $this->getIndentDepth($o_text, $tab_width);
$n_depth = $this->getIndentDepth($n_text, $tab_width);