diff options
author | Yee Cheng Chin <ychin.git@gmail.com> | 2023-10-17 10:56:25 +0200 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2023-10-17 10:56:25 +0200 |
commit | 209ec90b9b9bd948d76511c9cd2b17f47a97afe6 (patch) | |
tree | 5a74b51ad3571a32852a7348b77c3637cf8fb8ce /src/ex_docmd.c | |
parent | 396058acd0cc66e5071d052e03d2067b134952af (diff) |
patch 9.0.2037: A few remaining cmdline completion issues with C-E/Yv9.0.2037
Problem: A few remaining cmdline completion issues with C-E/Y
Solution: Fix cmdline completion fuzzy/Ctrl-E/Ctrl-Y/options when not
used at the end
Fix cmdline completion fuzzy/Ctrl-E/Ctrl-Y/options when not used at the end
A few places in the cmdline completion code only works properly when the
user hits Tab (or 'wildchar') at the end of the cmdline, even though
it's supposed to work even in the middle of the line.
For fuzzy search, `:e ++ff`, and `:set hl=`, fix completion code to make
sure to use `xp_pattern_len` instead of assuming the entire `xp_pattern`
is the search pattern (since it contains texts after the cursor).
Fix Ctrl-E / Ctrl-Y to not jump to the end when canceling/accepting a
wildmenu completion. Also, make them work even when not using
`set wildoptions+=pum` as there is no drawback to doing so.
(Related issue where this was brought up: #13331)
closes: #13362
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r-- | src/ex_docmd.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c index f0c7aad7df..06837ac92c 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -5590,7 +5590,8 @@ expand_argopt( // Special handling of "ff" which acts as a short form of // "fileformat", as "ff" is not a substring of it. - if (STRCMP(xp->xp_pattern, "ff") == 0) + if (xp->xp_pattern_len == 2 + && STRNCMP(xp->xp_pattern, "ff", xp->xp_pattern_len) == 0) { *matches = ALLOC_MULT(char_u *, 1); if (*matches == NULL) |