Changeset View
Changeset View
Standalone View
Standalone View
src/ref/ArcanistRefView.php
Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | private function newLines($indent) { | ||||
// If the terminal is extremely narrow, don't degrade so much that the | // If the terminal is extremely narrow, don't degrade so much that the | ||||
// output is completely unusable. | // output is completely unusable. | ||||
$usable_width = max($usable_width, 16); | $usable_width = max($usable_width, 16); | ||||
// TODO: This should truncate based on console display width, not | // TODO: This should truncate based on console display width, not | ||||
// glyphs, but there's currently no "setMaximumConsoleCharacterWidth()". | // glyphs, but there's currently no "setMaximumConsoleCharacterWidth()". | ||||
$title = id(new PhutilUTF8StringTruncator()) | $title = (new PhutilUTF8StringTruncator()) | ||||
->setMaximumGlyphs($usable_width) | ->setMaximumGlyphs($usable_width) | ||||
->truncateString($title); | ->truncateString($title); | ||||
if ($object_name !== null) { | if ($object_name !== null) { | ||||
if (strlen($title)) { | if (strlen($title)) { | ||||
$display_text = tsprintf('**%s** %s', $object_name, $title); | $display_text = tsprintf('**%s** %s', $object_name, $title); | ||||
} else { | } else { | ||||
$display_text = tsprintf('**%s**', $object_name); | $display_text = tsprintf('**%s**', $object_name); | ||||
Show All 37 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0