Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15485668
D20182.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
D20182.diff
View Options
diff --git a/src/difference/ArcanistDiffUtils.php b/src/difference/ArcanistDiffUtils.php
--- a/src/difference/ArcanistDiffUtils.php
+++ b/src/difference/ArcanistDiffUtils.php
@@ -89,6 +89,9 @@
$highlight_o = '<span class="bright">';
$highlight_c = '</span>';
+ $depth_in = '<span class="depth-in">';
+ $depth_out = '<span class="depth-out">';
+
$is_html = false;
if ($str instanceof PhutilSafeHTML) {
$is_html = true;
@@ -107,11 +110,23 @@
$stack = array_shift($intra_stack);
$s = $e;
$e += $stack[1];
- } while ($stack[0] == 0);
+ } while ($stack[0] === 0);
+
+ switch ($stack[0]) {
+ case '>':
+ $open_tag = $depth_in;
+ break;
+ case '<':
+ $open_tag = $depth_out;
+ break;
+ default:
+ $open_tag = $highlight_o;
+ break;
+ }
}
if (!$highlight && !$tag && !$ent && $p == $s) {
- $buf .= $highlight_o;
+ $buf .= $open_tag;
$highlight = true;
}
@@ -139,7 +154,7 @@
if ($tag && $str[$i] == '>') {
$tag = false;
if ($highlight) {
- $buf .= $highlight_o;
+ $buf .= $open_tag;
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Apr 11, 1:37 AM (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7715395
Default Alt Text
D20182.diff (1 KB)
Attached To
Mode
D20182: Add Arcanist support for highlighting indent change intraline diffs
Attached
Detach File
Event Timeline
Log In to Comment