[vim/vim] cmdexpand: allow dict items in customlist completion (PR #20100)

4 views
Skip to first unread message

mattn

unread,
Apr 29, 2026, 11:27:31 PM (2 days ago) Apr 29
to vim/vim, Subscribed

Extend customlist completion so each returned list item may be a Dict with word (required) plus optional abbr, kind, menu, and info keys, surfaced through the cmdline pum the same way complete() does in insert mode. String items keep working as before.


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

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

Commit Summary

  • 55358fc cmdexpand: allow dict items in customlist completion
  • 2148c60 cmdexpand: support "abbr" in customlist dict items

File Changes

(4 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/20100@github.com>

mattn

unread,
Apr 30, 2026, 1:40:42 AM (yesterday) Apr 30
to vim/vim, Push

@mattn pushed 1 commit.

  • a209c49 docs: fix dangling |+popup| reference, use |+popupwin|


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/20100/before/2148c609536bdcecec85b1659714a5d0e7ce3b7f/after/a209c49903edbc3ad4562184f1cc9d6c46742e3c@github.com>

mattn

unread,
Apr 30, 2026, 2:08:09 AM (yesterday) Apr 30
to vim/vim, Push

@mattn pushed 1 commit.

  • 72e991d fix leak of customlist abbr/kind/menu/info on re-entry


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/20100/before/a209c49903edbc3ad4562184f1cc9d6c46742e3c/after/72e991ded6b7dda45892b0b6a98983fd2e14636d@github.com>

Maxim Kim

unread,
Apr 30, 2026, 3:08:22 AM (yesterday) Apr 30
to vim/vim, Subscribed
habamax left a comment (vim/vim#20100)

That would be a great improvement! 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/20100/c4350372031@github.com>

Christian Brabandt

unread,
9:09 AM (4 hours ago) 9:09 AM
to vim/vim, Subscribed

@chrisbra commented on this pull request.

Thanks, but I have some comments, see below


In src/cmdexpand.c:

> +	if (xp->xp_files_kind != NULL)
+	{
+	    FreeWild(numMatches, xp->xp_files_kind);
+	    xp->xp_files_kind = NULL;
+	}
+	if (xp->xp_files_menu != NULL)
+	{
+	    FreeWild(numMatches, xp->xp_files_menu);
+	    xp->xp_files_menu = NULL;
+	}
+	if (xp->xp_files_info != NULL)
+	{
+	    FreeWild(numMatches, xp->xp_files_info);
+	    xp->xp_files_info = NULL;
+	}
+    }

That part is duplicated 3 times. Can you move it into a helper function?


In src/cmdexpand.c:

>  
-	p = vim_strsave(li->li_tv.vval.v_string);
 	if (p == NULL)
 	    break;

So if we went into the VAR_DICT case above and allocating to p fails, this leaks abbr, kind, menu and info.


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/20100/review/4211207168@github.com>

Reply all
Reply to author
Forward
0 new messages