Does popup_menu() functions asynchronous?

10 views
Skip to first unread message

Piotr Kolasiński

unread,
Mar 3, 2026, 3:41:56 AM (3 days ago) Mar 3
to vim_use
I try to use popup_menu() in linear code like:

——

func PopupResult(id, sel)
    let g:popup_sel = a:result
    echo "In popup: " .. g:result
endfunc

call popup_menu(["A","B","C"], #{ callback: 'PopupResult' })

echo 'After popup'

——-

but 'After popup’ is displayed immediately, not waiting for finish the call. 
Does popup_menu works asynchronous? How can I execute such code in linear way?

Piotr

M

unread,
9:10 AM (8 hours ago) 9:10 AM
to vim...@googlegroups.com


вт, 3 мар. 2026 г., 11:41 Piotr Kolasiński <ptk...@gmail.com>:
--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/78474f86-0bd6-401c-bdc3-fc85b4ca7b45n%40googlegroups.com.

Hello,

No you can't. The good news is that you hardly ever need it. Just return and continue execution from the callback function. The way typical for _modeless_ dialogs.

Regards,
Matvey
Reply all
Reply to author
Forward
0 new messages