From b1e36d7d1f4200e8de445b28ff6eb6dcf4e0c433 Mon Sep 17 00:00:00 2001 From: "Jaremy J. Creechley" Date: Fri, 3 Dec 2021 17:25:16 -0800 Subject: [PATCH 1/3] menu select add arrows --- src/nimblepkg/cli.nim | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/nimblepkg/cli.nim b/src/nimblepkg/cli.nim index b69cd43d..40b2fbca 100644 --- a/src/nimblepkg/cli.nim +++ b/src/nimblepkg/cli.nim @@ -257,6 +257,16 @@ proc promptListInteractive(question: string, args: openarray[string]): string = of '\3': showCursor(stdout) raise nimbleError("Keyboard interrupt") + of '\27': + if getch() != '\91': continue + case getch(): + of char 65: + current = (args.len + current - 1) mod args.len + break + of char 66: + current = (current + 1) mod args.len + break + else: discard else: discard # Erase all lines of the selection From f5feee071e652f9493ce9cda8d0750945692bc49 Mon Sep 17 00:00:00 2001 From: Dominik Picheta Date: Sat, 4 Dec 2021 18:17:17 +0000 Subject: [PATCH 2/3] Update src/nimblepkg/cli.nim --- src/nimblepkg/cli.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nimblepkg/cli.nim b/src/nimblepkg/cli.nim index 40b2fbca..4392d4d7 100644 --- a/src/nimblepkg/cli.nim +++ b/src/nimblepkg/cli.nim @@ -260,7 +260,7 @@ proc promptListInteractive(question: string, args: openarray[string]): string = of '\27': if getch() != '\91': continue case getch(): - of char 65: + of char(65): # Up arrow current = (args.len + current - 1) mod args.len break of char 66: From 8edc599e74239f7a255668188e307bb56e44b605 Mon Sep 17 00:00:00 2001 From: Dominik Picheta Date: Sat, 4 Dec 2021 18:17:22 +0000 Subject: [PATCH 3/3] Update src/nimblepkg/cli.nim --- src/nimblepkg/cli.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nimblepkg/cli.nim b/src/nimblepkg/cli.nim index 4392d4d7..be2a335b 100644 --- a/src/nimblepkg/cli.nim +++ b/src/nimblepkg/cli.nim @@ -263,7 +263,7 @@ proc promptListInteractive(question: string, args: openarray[string]): string = of char(65): # Up arrow current = (args.len + current - 1) mod args.len break - of char 66: + of char(66): # Down arrow current = (current + 1) mod args.len break else: discard