Commit a042418
committed
Help message in the completion bar, for auto-discoverable bindings
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:
```
utop # Ar
┌───┬────────────┬─────┬───────────┬─────────────────────────────────────────────────┐
│Arg│Arith_status│Array│ArrayLabels│ │
└───┴────────────┴─────┴───────────┴─────────────────────────────────────────────────┘
```
After:
```
utop # Ar
┌───┬────────────┬─────┬───────────┬─────────────────────────────────────────────────┐
│Arg│Arith_status│Array│ArrayLabels│ (M-left, M-right, M-enter)│
└───┴────────────┴─────┴───────────┴─────────────────────────────────────────────────┘
```
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.1 parent 5d46116 commit a042418
1 file changed
+5
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
942 | 942 | | |
943 | 943 | | |
944 | 944 | | |
945 | | - | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
946 | 950 | | |
947 | 951 | | |
948 | 952 | | |
| |||
0 commit comments