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.
—
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.![]()
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.![]()
—
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.![]()
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.![]()
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.![]()