Skip to content

Commit 94a3d5b

Browse files
authored
Better this way
1 parent d7bebfd commit 94a3d5b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/CliMenu.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,14 +366,17 @@ protected function drawMenuItem(MenuItemInterface $item, bool $selected = false)
366366
$invertedColour = $selected
367367
? $this->style->getInvertedColoursSetCode()
368368
: '';
369+
$notInvertedColour = $selected
370+
? $this->style->getInvertedColoursUnsetCode()
371+
: '';
369372

370373
if ($this->style->getBorderLeftWidth() || $this->style->getBorderRightWidth()) {
371374
$borderColour = $this->style->getBorderColourCode();
372375
} else {
373376
$borderColour = '';
374377
}
375378

376-
return array_map(function ($row) use ($setColour, $invertedColour, $resetColour, $borderColour) {
379+
return array_map(function ($row) use ($setColour, $invertedColour, $notInvertedColour, $resetColour, $borderColour) {
377380
return sprintf(
378381
"%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
379382
str_repeat(' ', $this->style->getMargin()),
@@ -384,7 +387,7 @@ protected function drawMenuItem(MenuItemInterface $item, bool $selected = false)
384387
str_repeat(' ', $this->style->getPadding()),
385388
$row,
386389
str_repeat(' ', $this->style->getRightHandPadding(mb_strlen(s::stripAnsiEscapeSequence($row)))),
387-
$this->style->getInvertedColoursUnsetCode(),
390+
$notInvertedColour,
388391
$borderColour,
389392
str_repeat(' ', $this->style->getBorderRightWidth()),
390393
$resetColour,

0 commit comments

Comments
 (0)