[vim/vim] `customlist` dict can't update info asynchronously (Issue #20175)

7 views
Skip to first unread message

Mao-Yining

unread,
May 9, 2026, 10:59:09 AM (2 days ago) May 9
to vim/vim, Subscribed
mao-yining created an issue (vim/vim#20175)
vim9script
augroup Test
    au!
    au CmdlineChanged : UpdateInfo()
augroup END

def UpdateInfo()
    if getcmdcompltype() != 'customlist,Complete'
        return
    endif
    var id = popup_findinfo()
    if id != 0
        id->popup_settext('done')
        popup_show(id)
        redraw  " Without this, info never appears
    endif
enddef

def Complete(_, _, _): list<dict<any>>
    return [{word: '1', info: 'lazy'}]
enddef

command! -nargs=1 -complete=customlist,Complete Test echo <args>

Expected: Info popup updates asynchronously in CmdlineChanged (like :h complete-popuphidden for insert-mode completion).

Actual: Info popup only appears briefly when redraw is called. Without redraw, no update occurs.

Problem: customlist returning dicts with info cannot refresh asynchronously. This works for complete-popuphidden but not for cmdline completion.

Request: Add async update support for customlist dict info popups in cmdline context.

Note: Using CmdlineChanged is a hack. Ideally, something like CompleteChanged should be available for this purpose.

Cc: @mattn @zeertzjq


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/issues/20175@github.com>

Mao-Yining

unread,
May 10, 2026, 12:05:51 AM (yesterday) May 10
to vim/vim, Subscribed
mao-yining left a comment (vim/vim#20175)

For preview window:

vim9script
set wildmenu wildoptions=pum wildcharm=<Tab>
augroup Test
	au!
	au CmdlineChanged : UpdateInfo()
augroup END

def UpdateInfo()
	if getcmdcompltype() != 'customlist,Complete'
		return
	endif
	for winnr in range(1, winnr('$'))
		if winnr->getwinvar('&previewwindow')
			var bufnr = winbufnr(winnr)
			setbufvar(bufnr, '&modifiable', true)
			setbufline(bufnr, 1, 'done')
			setbufvar(bufnr, '&modifiable', false)
			redraw # Add this can work, with out this can't work.
			break
		endif
	endfor
enddef

def Complete(_, _, _): list<dict<any>
>
	return [{word: '1', info: 'lazy'}, {word: '2', info: 'lazy'}]
enddef
command! -nargs=1 -complete=customlist,Complete Test echo <args>
map t :Test<Space><Tab>


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/issues/20175/4414393098@github.com>

Christian Brabandt

unread,
May 10, 2026, 2:26:40 PM (22 hours ago) May 10
to vim/vim, Subscribed

Closed #20175 as completed via ef1ecc3.


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/issue/20175/issue_event/25357130639@github.com>

Maxim Kim

unread,
May 10, 2026, 8:46:17 PM (15 hours ago) May 10
to vim/vim, Subscribed
habamax left a comment (vim/vim#20175)

Thanks @mattn for the redraw fix.

Do you think :h CompleteChanged could be extended to cover command line completion?


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/issues/20175/4416807006@github.com>

mattn

unread,
May 10, 2026, 10:40:16 PM (13 hours ago) May 10
to vim/vim, Subscribed
mattn left a comment (vim/vim#20175)

I think a separate event would be cleaner. Cmdline completion items don't share the same shape as |complete-items|, so v:event for CompleteChanged (completed_item, etc.) wouldn't map naturally and ends up with mostly-empty fields in the cmdline case. A dedicated CmdlineCompleteChanged with its own v:event keys appropriate for the cmdline pum (selected index/text, size, position, ...) would keep the existing event's contract intact and avoid forcing handlers to branch on mode().


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/issues/20175/4417155090@github.com>

Reply all
Reply to author
Forward
0 new messages