[vim/vim] cmdline: complete user :K* via ":k..." when 'ignorecase' (PR #20275)

2 views
Skip to first unread message

mattn

unread,
May 21, 2026, 12:22:07 AM (yesterday) May 21
to vim/vim, Subscribed

With 'ignorecase' set, :gz<Tab> completes to a user command :Gz, but :kz<Tab> does not reach a user command :Kz. This is because set_cmd_index() short-circuits any :k<X> as :k {X} (the mark argument) before command-name expansion runs.

Skip the short-circuit when p_ic is set so the input flows through the normal command-name expansion path. Default behaviour (noignorecase) is unchanged, so Test_cmdline_complete_various and Test_fuzzy_completion_cmd_k still pass.

A regression test is added that covers both noignorecase and ignorecase.

Fixes #20241


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/20275

Commit Summary

  • 7843b83 cmdline completion: complete user :K* via ":k..." when ignorecase

File Changes

(2 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20275@github.com>

zeertzjq

unread,
May 21, 2026, 1:30:41 AM (yesterday) May 21
to vim/vim, Subscribed

@zeertzjq commented on this pull request.


In src/cmdexpand.c:

> @@ -1759,11 +1759,11 @@ set_cmd_index(char_u *cmd, exarg_T *eap, expand_T *xp, int *complp)
     // Isolate the command and search for it in the command table.
     // Exceptions:
     // - the 'k' command can directly be followed by any character, but do
-    // accept "keepmarks", "keepalt" and "keepjumps". As fuzzy matching can
-    // find matches anywhere in the command name, do this only for command
-    // expansion based on regular expression and not for fuzzy matching.
+    // accept "keepmarks", "keepalt" and "keepjumps". Bypass also when
+    // 'ignorecase' is set so a lowercase ":kz" still completes a user
+    // command like :Kz (#20241), and for fuzzy matching as before.
⬇️ Suggested change
-    // command like :Kz (#20241), and for fuzzy matching as before.
+    // command like :Kz (#20241), and for fuzzy matching as that can find
+    // matches anywhere in the command name.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20275/review/4334199052@github.com>

mattn

unread,
May 21, 2026, 1:37:16 AM (yesterday) May 21
to vim/vim, Push

@mattn pushed 1 commit.


View it on GitHub or unsubscribe.


Triage notifications on the go with GitHub Mobile for iOS or Android.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20275/before/7843b836d00a3191f8d87722b5b2d2a4ea449b6e/after/6d1643d8fc06ea3dd5664f639f9c50af20039e20@github.com>

mattn

unread,
May 21, 2026, 1:37:54 AM (yesterday) May 21
to vim/vim, Subscribed
mattn left a comment (vim/vim#20275)

@zeertzjq Right, thank you


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20275/c4505110326@github.com>

Christian Brabandt

unread,
May 21, 2026, 3:56:46 PM (18 hours ago) May 21
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#20275)

thanks both 🙇‍♂️


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20275/c4512267400@github.com>

Christian Brabandt

unread,
May 21, 2026, 4:05:19 PM (17 hours ago) May 21
to vim/vim, Subscribed

Closed #20275 via b54e57e.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20275/issue_event/25822462210@github.com>

Reply all
Reply to author
Forward
0 new messages