Skip to content

Commit ff16a3d

Browse files
committed
Fix raw_select
1 parent 5aad207 commit ff16a3d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/inquire/prompts/prompt_raw_select.ml

+6-3
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ let prompt ?default ?style ~options message =
4141
()
4242
| n ->
4343
Ansi.move_bol ();
44-
Ansi.move_cursor 0 (-1 * (n - 1));
44+
Ansi.move_cursor 0 (-1 * n);
4545
Ansi.erase Ansi.Below;
4646
flush stdout
4747
in
@@ -50,8 +50,8 @@ let prompt ?default ?style ~options message =
5050
let select i =
5151
input := Some i;
5252
reset ();
53-
print_input ();
54-
print_options ()
53+
print_options ();
54+
print_input ()
5555
in
5656
print_prompt ?style message;
5757
print_string "\n";
@@ -63,6 +63,9 @@ let prompt ?default ?style ~options message =
6363
| 10, Some input ->
6464
(* Enter *)
6565
reset ();
66+
Ansi.move_cursor 0 (-1);
67+
Ansi.erase Ansi.Eol;
68+
print_prompt ?style message;
6669
let input = List.nth options input in
6770
print_string input;
6871
print_string "\n";

0 commit comments

Comments
 (0)