Lua primitives: choose_string()
The choose_string function allows you to prompt the user to make a selection from a small number of possible options.
It is primarily designed for our TAB-completion code, but due to its flexible nature it can be used for building simple menus, selecting signatures, or GPG keys, for example.
choice = prompt( "Depeche Mode", "Curve", "Prince" ); msg( "You entered: " .. choice );
The function expects to receive an array of choices, and will return either the string chosen or "" if the user cancels the menu without choosing anything.
TAB and the arrow-keys may be used to highlight the desired choice, and the selection is confirmed via RETURN, or canceled via Esc.
This function has been available since version 0.18.