Thursday, March 5, 2026

Re: Does popup_menu() functions asynchronous?



вт, 3 мар. 2026 г., 11:41 Piotr Kolasiński <ptkola@gmail.com>:
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

--
--
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+unsubscribe@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

--
--
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+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/CAFsTB%2B%2B32J5Qe4eLLhN3QighXUS8KxT%2BsEv%3DkUDOx7OtLCYqGQ%40mail.gmail.com.

No comments: