Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/parser/DifferentialChangesetParser.php
Show First 20 Lines • Show All 1,594 Lines • ▼ Show 20 Lines | |||||
public static function replaceTabsWithSpaces($line, $tab_width) { | public static function replaceTabsWithSpaces($line, $tab_width) { | ||||
static $tags = array(); | static $tags = array(); | ||||
if (empty($tags[$tab_width])) { | if (empty($tags[$tab_width])) { | ||||
for ($ii = 1; $ii <= $tab_width; $ii++) { | for ($ii = 1; $ii <= $tab_width; $ii++) { | ||||
$tag = phutil_tag( | $tag = phutil_tag( | ||||
'span', | 'span', | ||||
array( | array( | ||||
'data-copy-text' => "\t", | 'data-copy-text' => "\t", | ||||
// See PHI1814. Mark this as a single logical tab for the purposes | |||||
// of text selection behavior: when the user drags their mouse over | |||||
// the character sequence, we'd like the whole thing to select as | |||||
// a single unit. | |||||
'class' => 'logical-tab', | |||||
), | ), | ||||
str_repeat(' ', $ii)); | str_repeat(' ', $ii)); | ||||
$tag = phutil_string_cast($tag); | $tag = phutil_string_cast($tag); | ||||
$tags[$ii] = $tag; | $tags[$ii] = $tag; | ||||
} | } | ||||
} | } | ||||
// Expand all prefix tabs until we encounter any non-tab character. This | // Expand all prefix tabs until we encounter any non-tab character. This | ||||
▲ Show 20 Lines • Show All 345 Lines • Show Last 20 Lines |