Commit bbafa1b
committed
fix regression accepting pathname completion
Ensure that when accepting a pathname completion, the path as typed is
accepted and not modified into an invalid path.
Changes
* use a Literal for the include argument to last_word()
* create a separate length-measurement string for pathname completions,
based on a different last-word cleanup regex
* remove some todo comments from tests which are now resolved
The logic of length_based_on_path assumes that if _any_ of the
suggestions are pathnames, then _all_ of the suggestions are pathnames,
which is currently true, and likely to remain true.
It would be nice to have a test which simulated accepting the first
suggestion, to check that the filled-in completion does not get mangled,
as happened before.1 parent 6439405 commit bbafa1b
File tree
4 files changed
+52
-8
lines changed- mycli
- packages
- test
4 files changed
+52
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
1 | 9 | | |
2 | 10 | | |
3 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
38 | 46 | | |
39 | 47 | | |
40 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1075 | 1075 | | |
1076 | 1076 | | |
1077 | 1077 | | |
| 1078 | + | |
1078 | 1079 | | |
1079 | 1080 | | |
1080 | 1081 | | |
| |||
1088 | 1089 | | |
1089 | 1090 | | |
1090 | 1091 | | |
| 1092 | + | |
1091 | 1093 | | |
1092 | 1094 | | |
1093 | 1095 | | |
| |||
1196 | 1198 | | |
1197 | 1199 | | |
1198 | 1200 | | |
| 1201 | + | |
1199 | 1202 | | |
1200 | 1203 | | |
1201 | 1204 | | |
| |||
1238 | 1241 | | |
1239 | 1242 | | |
1240 | 1243 | | |
1241 | | - | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
1242 | 1248 | | |
1243 | 1249 | | |
1244 | 1250 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
631 | 631 | | |
632 | 632 | | |
633 | 633 | | |
634 | | - | |
635 | | - | |
636 | 634 | | |
637 | 635 | | |
638 | | - | |
639 | | - | |
640 | | - | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
641 | 639 | | |
642 | 640 | | |
643 | 641 | | |
| |||
697 | 695 | | |
698 | 696 | | |
699 | 697 | | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
700 | 722 | | |
701 | 723 | | |
702 | 724 | | |
| |||
0 commit comments