Fix #579
This commit is contained in:
parent
22aa3c1d13
commit
10260a1223
1 changed files with 7 additions and 5 deletions
|
|
@ -43,6 +43,8 @@ const
|
||||||
[fgRed, fgYellow, fgCyan, fgGreen]
|
[fgRed, fgYellow, fgCyan, fgGreen]
|
||||||
styles: array[DebugPriority .. HighPriority, set[Style]] =
|
styles: array[DebugPriority .. HighPriority, set[Style]] =
|
||||||
[{styleDim}, {styleDim}, {}, {styleBright}]
|
[{styleDim}, {styleDim}, {}, {styleBright}]
|
||||||
|
arrowL = when defined(windows): "> " else: "▸ " ## CLI Arrow indicator Left.
|
||||||
|
arrowR = when defined(windows): " <" else: " ◂" ## CLI Arrow indicator Right.
|
||||||
|
|
||||||
proc newCLI(): CLI =
|
proc newCLI(): CLI =
|
||||||
result = CLI(
|
result = CLI(
|
||||||
|
|
@ -192,15 +194,15 @@ proc promptListInteractive(question: string, args: openarray[string]): string =
|
||||||
while not selected:
|
while not selected:
|
||||||
# Loop through the options
|
# Loop through the options
|
||||||
for i, arg in args:
|
for i, arg in args:
|
||||||
|
setBackgroundColor(bgBlack) # We dont known theme of terminal, use Black.
|
||||||
|
setForegroundColor(fgWhite)
|
||||||
# Check if the option is the current
|
# Check if the option is the current
|
||||||
if i == current:
|
if i == current:
|
||||||
setForegroundColor(fgWhite)
|
writeStyled(arrowL & arg & arrowR, {styleBright, styleUnderscore, styleReverse})
|
||||||
writeStyled(" " & arg, {styleBright})
|
|
||||||
else:
|
else:
|
||||||
setForegroundColor(fgWhite)
|
writeStyled(" " & arg & " ", {styleDim})
|
||||||
writeStyled(" " & arg, {styleDim})
|
|
||||||
# Move the cursor back to the start
|
# Move the cursor back to the start
|
||||||
for s in 0..<(arg.len + 1):
|
for s in 0..<(arg.len + 4):
|
||||||
cursorBackward(stdout)
|
cursorBackward(stdout)
|
||||||
# Move down for the next item
|
# Move down for the next item
|
||||||
cursorDown(stdout)
|
cursorDown(stdout)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue