From 10260a12237fd1dd63bd167e02bb2cf456c096e6 Mon Sep 17 00:00:00 2001 From: juancarlospaco Date: Mon, 12 Nov 2018 03:36:45 -0300 Subject: [PATCH] Fix #579 --- src/nimblepkg/cli.nim | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/nimblepkg/cli.nim b/src/nimblepkg/cli.nim index ab9f494..c8a39bf 100644 --- a/src/nimblepkg/cli.nim +++ b/src/nimblepkg/cli.nim @@ -43,6 +43,8 @@ const [fgRed, fgYellow, fgCyan, fgGreen] styles: array[DebugPriority .. HighPriority, set[Style]] = [{styleDim}, {styleDim}, {}, {styleBright}] + arrowL = when defined(windows): "> " else: "▸ " ## CLI Arrow indicator Left. + arrowR = when defined(windows): " <" else: " ◂" ## CLI Arrow indicator Right. proc newCLI(): CLI = result = CLI( @@ -192,15 +194,15 @@ proc promptListInteractive(question: string, args: openarray[string]): string = while not selected: # Loop through the options for i, arg in args: + setBackgroundColor(bgBlack) # We dont known theme of terminal, use Black. + setForegroundColor(fgWhite) # Check if the option is the current if i == current: - setForegroundColor(fgWhite) - writeStyled(" " & arg, {styleBright}) + writeStyled(arrowL & arg & arrowR, {styleBright, styleUnderscore, styleReverse}) else: - setForegroundColor(fgWhite) - writeStyled(" " & arg, {styleDim}) + writeStyled(" " & arg & " ", {styleDim}) # Move the cursor back to the start - for s in 0..<(arg.len + 1): + for s in 0..<(arg.len + 4): cursorBackward(stdout) # Move down for the next item cursorDown(stdout)