Commit 04ef6c2
authored
Right arrow autocompletes at line end (#54983)
This commit adds a REPL feature: autocompletion when the right arrow key
is pressed at the end of a line (The current behavior is to do nothing).
This new effect only occurs when:
- the cursor is at the end of the buffer,
- there is only one possible completion, and
- more than 1 character is in the buffer.
In this situation, the right arrow key behaves like `<Tab>`. Otherwise,
the right arrow key behaves as normal.
The feature was requested in #54539 and seems intuitive to me. One
useful side effect is that, by requiring that the cursor be at the end
of the line, it offers a way to avoid autcompletes within words, which I
assume are almost never helpful (For example, if I type "show" in the
REPL, move the cursor onto the 'o' and press `<Tab>`, I end up with
"showow"). One potential drawback is that the autocomplete could occur
when a user who simply wants to move the cursor to the end of the line
holds down the right arrow.1 parent 9dd49c0 commit 04ef6c2
1 file changed
+20
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
741 | 741 | | |
742 | 742 | | |
743 | 743 | | |
744 | | - | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
745 | 764 | | |
746 | 765 | | |
747 | 766 | | |
| |||
0 commit comments