Help message in the completion bar, for auto-discoverable bindings #24
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Having #utop_help;; is great, but the best help is a feature that user
can discover during their normal interaction with the tool. (utop is
already strong on this point thanks to the fact that, for example,
typing
#
allows to discover toplevel directives.)This patch makes the key-bindings useful to navigate the completion
bar auto-discoverable by printing them (right-justified) inside the
bar whenever there is enough space to do so.
Before:
After:
This patch is only a very first attempt to get this feature
(in limited time). Hard-coding the precise key-bindings at the
lambda-term level is certainly the wrong design choice. I suppose the
help message should be configurable, and I would welcome advice on
what a better interface would be.
Also, we could discuss other "auto-discovery features" that would benefit utop and other lambda-term-using projects. For example right now when nothing is typed in the bar, utop proposes to complete module identifiers, and it is kind of noisy and not so useful in my opinion. I would rather use the space to provide some hints of useful key-bindings that users will not naturally try (I mean the basic history navigation is intuitive and familiar, but for example notifying users that search-in-history is available could be useful). We could have a fixed hint message, or rotate. What do you think?