Closed intentionaccident closed 8 years ago
I have confirmed the behavior in my setup. I'll be taking a look at it.
Dear @strigonLeader,
I'm sorry but you're right, this particular need has no intuitive way of doing it.
Reviewing the code I could see that, when "reasking" the question in the face of an error HighLine doesn't show the prompt you set up. Instead, it shows the responses[:ask_on_error]
string.
And... for menus, there were no easy way to overwrite it.
I have made a simple workaround in a PR that I'm pushing that allows it to be overwritten.
You should add the following line inside the configuration block.
menu.responses[:ask_on_error] = "> "
So your complete example would be:
require 'highline/import'
choose do |menu|
menu.prompt = "> "
menu.responses[:ask_on_error] = "> "
menu.choice :exit, "Exit cube editor" do
abort("Exiting")
end
end
When I have more time I will rework this to something more straightforward.
After a failed selection the promt defaults to '? ' I hope I'm not missing something in the API.