Skip to content

Commit

Permalink
Fix the default key display in TUI's [warnPrinter]
Browse files Browse the repository at this point in the history
Define Enter explicitly as input in the TUI warning printer. This is not
a functional change, it only changes the default key that is displayed
to the user, to match the prompt.

Enter/Return as input is treated as the default selection, as if user
had pressed any of the default keys for the respective action (if there
are multiple default keys defined then they are all equivalent). The
first default input key is displayed to the user so they know what
action is the default.

In the warning printer the first default input key used to be <space>.
This was a bit confusing as the prompt reads "Press return to continue."
This patch defines Enter as the default input key in its own right,
while also making it the first default which gets displayed to the user.
  • Loading branch information
tleedjarv committed Jan 23, 2025
1 parent 9d15a10 commit 06df94b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/uitext.ml
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,7 @@ let setWarnPrinter() =
if not (Prefs.read Globals.batch) then begin
display "Press return to continue.";
selectAction None
[(["";" ";"y"],
[(["";"";" ";"y"],
("Continue"),
(fun () -> newLine()));
(["n";"q";"x"],
Expand Down

0 comments on commit 06df94b

Please sign in to comment.