Commit 94a20e7
committed
fix(cmdline): trigger autocorrection only if appending single character
Details:
- Although appending multiple characters with a single key stroke is
possible (like with `:cnoremap <C-x> www` or `:nnoremap <C-y> :ehco`),
making it work with autocorrection is problematic.
Currently it just treats new text as a single "separator character"
and tries to autocorrect the text that was prior to it. This is
problematic for navigating through history: if previous command is
`:Pick files`, typing `:P<Up>` will treat `ick files` as a separator
character and autocorrect `P`->`p` (as it is a valid autocorrection).
Ideally it would be nice to have autocorrect all words that were
created after appending new text, but that is problematic. Mostly
because there is (currently) no way to actually compute these words
(`vim.fn.getcomplpat()` works only for current command line text and
cursor; moving cursor for this case is not quite clean).
So instead make it more explicit that autocorrection is triggered only
if *a single character* is appended to the command line text. This was
more or less the initial intention, so do not mark as a breaking
change.1 parent b8b0c3b commit 94a20e7
File tree
3 files changed
+38
-40
lines changed- doc
- lua/mini
- tests
3 files changed
+38
-40
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
191 | | - | |
192 | | - | |
193 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
162 | | - | |
163 | | - | |
164 | | - | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
| |||
759 | 759 | | |
760 | 760 | | |
761 | 761 | | |
762 | | - | |
763 | | - | |
| 762 | + | |
| 763 | + | |
764 | 764 | | |
765 | | - | |
| 765 | + | |
| 766 | + | |
766 | 767 | | |
767 | 768 | | |
768 | | - | |
| 769 | + | |
769 | 770 | | |
770 | 771 | | |
771 | 772 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
894 | 894 | | |
895 | 895 | | |
896 | 896 | | |
897 | | - | |
898 | | - | |
899 | | - | |
900 | | - | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
901 | 910 | | |
902 | 911 | | |
903 | 912 | | |
| |||
924 | 933 | | |
925 | 934 | | |
926 | 935 | | |
927 | | - | |
928 | | - | |
929 | | - | |
930 | | - | |
931 | | - | |
932 | | - | |
933 | | - | |
934 | | - | |
935 | | - | |
936 | | - | |
937 | | - | |
938 | | - | |
939 | | - | |
940 | | - | |
941 | | - | |
942 | | - | |
943 | | - | |
944 | | - | |
945 | | - | |
946 | | - | |
947 | 936 | | |
948 | 937 | | |
949 | 938 | | |
| |||
960 | 949 | | |
961 | 950 | | |
962 | 951 | | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
963 | 960 | | |
964 | 961 | | |
965 | 962 | | |
| |||
1065 | 1062 | | |
1066 | 1063 | | |
1067 | 1064 | | |
1068 | | - | |
| 1065 | + | |
1069 | 1066 | | |
1070 | 1067 | | |
1071 | 1068 | | |
| |||
1101 | 1098 | | |
1102 | 1099 | | |
1103 | 1100 | | |
1104 | | - | |
1105 | | - | |
1106 | | - | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
1107 | 1104 | | |
1108 | 1105 | | |
1109 | | - | |
| 1106 | + | |
1110 | 1107 | | |
1111 | 1108 | | |
1112 | 1109 | | |
1113 | 1110 | | |
1114 | 1111 | | |
1115 | 1112 | | |
1116 | | - | |
| 1113 | + | |
1117 | 1114 | | |
1118 | 1115 | | |
1119 | 1116 | | |
| |||
0 commit comments