Prevent menu items from overflowing
This commit is contained in:
parent
ed57eec3b0
commit
9819b22019
@ -110,6 +110,7 @@ class Menu
|
|||||||
} elseif (is_null($item)) {
|
} elseif (is_null($item)) {
|
||||||
$item = str_repeat(" ", $width - 2);
|
$item = str_repeat(" ", $width - 2);
|
||||||
} else {
|
} else {
|
||||||
|
$item = mb_substr($item, 0, $width);
|
||||||
$item = " " . $item . str_repeat(" ", $width - 3 - $this->itemlen($item)) . "\e[40;37m";
|
$item = " " . $item . str_repeat(" ", $width - 3 - $this->itemlen($item)) . "\e[40;37m";
|
||||||
$item = (($n == $this->index)?"\e[37;44m":"\e[40;37m") . $item;
|
$item = (($n == $this->index)?"\e[37;44m":"\e[40;37m") . $item;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user