ocaml-community / utop

Universal toplevel for OCaml
Other
846 stars 113 forks source link

Lighter completion styles #143

Open gasche opened 8 years ago

gasche commented 8 years ago

Some users complain that the way utop handles the completion bar is too visually invasive. I propose the following features to let people select a less fancy completion mode.

  1. Hide the completion bar when no input has been entered. (I think this could be the default)
  2. Provide a mode to show the completion bar only once "tab" has been entered on the first time.
  3. Provide a mode that does not show a completion bar at all, and instead show a (reverse|underline)-styled proposed suffix -- visualizing the to-be-completed-suffix allows to still use the navigation commands.

Mode (3) never shows the list of choices, so it cannot be used for self-discovery of names and features (toplevel directives).

whitequark commented 8 years ago

But the mode (3) can, namely by using the same Alt+← and Alt+→ shortcuts to scroll the list. I personally also think that would be the most convenient mode.

gasche commented 8 years ago

Rather than "cannot be used" I would say "it is less suitable for": seeing the actual list of choice makes it noticeably easier to discover alternatives (when you are looking for a given completion, you also see the other choices and this may raise your curiosity to look at another choice later; with the scrolling interface you will stop at the desired choice).

For this reason I would not suggest to set it as the default. It may be interesting to think of hybrid modes (for example: having the list when no choice has been made yet, and moving to the most-silent mode as soon as an alphabetic prefix has been entered), but for now having these simple choices available for selection is the right first step.