Re: Does popup_menu() functions asynchronous?

M <[email protected]> Thu, 5 Mar 2026 17:09:57 +0300
Newsgroups gmane.editors.vim
Message-ID <CAFsTB++32J5Qe4eLLhN3QighXUS8KxT+sEv=kUDOx7OtLCYqGQ@mail.gmail.com>
--000000000000a6128b064c477ef9
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

=D0=B2=D1=82, 3 =D0=BC=D0=B0=D1=80. 2026 =D0=B3., 11:41 Piotr Kolasi=C5=84s=
ki <[email protected]>:

> I try to use popup_menu() in linear code like:
>
> =E2=80=94=E2=80=94
>
> func PopupResult(id, sel)
>     let g:popup_sel =3D a:result
>     echo "In popup: " .. g:result
> endfunc
>
> call popup_menu(["A","B","C"], #{ callback: 'PopupResult' })
>
> echo 'After popup'
>
> =E2=80=94=E2=80=94-
>
> but 'After popup=E2=80=99 is displayed immediately, not waiting for finis=
h 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 [email protected].
> To view this discussion visit
> https://groups.google.com/d/msgid/vim_use/78474f86-0bd6-401c-bdc3-fc85b4c=
a7b45n%40googlegroups.com
> <https://groups.google.com/d/msgid/vim_use/78474f86-0bd6-401c-bdc3-fc85b4=
ca7b45n%40googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter>
> .
>

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

>

--=20
--=20
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

---=20
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 e=
mail to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/vim_use/CAF=
sTB%2B%2B32J5Qe4eLLhN3QighXUS8KxT%2BsEv%3DkUDOx7OtLCYqGQ%40mail.gmail.com.

--000000000000a6128b064c477ef9
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto"><div><br><br><div class=3D"gmail_quote gmail_quote_contai=
ner"><div dir=3D"ltr" class=3D"gmail_attr">=D0=B2=D1=82, 3 =D0=BC=D0=B0=D1=
=80. 2026 =D0=B3., 11:41 Piotr Kolasi=C5=84ski &lt;<a href=3D"mailto:ptkola=
@gmail.com">[email protected]</a>&gt;:<br></div><blockquote class=3D"gmail_q=
uote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1e=
x">I try to use popup_menu() in linear code like:<div><br></div><div>=E2=80=
=94=E2=80=94</div><div><br></div><div>func PopupResult(id, sel)</div><div>=
=C2=A0 =C2=A0 let g:popup_sel =3D a:result</div><div>=C2=A0 =C2=A0 echo &qu=
ot;In popup: &quot; .. g:result</div><div>endfunc</div><div><br></div><div>=
call popup_menu([&quot;A&quot;,&quot;B&quot;,&quot;C&quot;], #{ callback: &=
#39;PopupResult&#39; })</div><div><br></div><div>echo &#39;After popup&#39;=
</div><div><br></div><div>=E2=80=94=E2=80=94-</div><div><br></div><div>but =
&#39;After popup=E2=80=99 is displayed immediately, not waiting for finish =
the call.=C2=A0</div><div>Does popup_menu works asynchronous? How can I exe=
cute such code in linear way?</div><div><br></div><div>Piotr</div>

<p></p>

-- <br>
-- <br>
You received this message from the &quot;vim_use&quot; maillist.<br>
Do not top-post! Type your reply below the text you are replying to.<br>
For more information, visit <a href=3D"http://www.vim.org/maillist.php" tar=
get=3D"_blank" rel=3D"noreferrer">http://www.vim.org/maillist.php</a><br>
<br>
--- <br>
You received this message because you are subscribed to the Google Groups &=
quot;vim_use&quot; group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:[email protected]" target=3D"_=
blank" rel=3D"noreferrer">[email protected]</a>.<br>
To view this discussion visit <a href=3D"https://groups.google.com/d/msgid/=
vim_use/78474f86-0bd6-401c-bdc3-fc85b4ca7b45n%40googlegroups.com?utm_medium=
=3Demail&amp;utm_source=3Dfooter" target=3D"_blank" rel=3D"noreferrer">http=
s://groups.google.com/d/msgid/vim_use/78474f86-0bd6-401c-bdc3-fc85b4ca7b45n=
%40googlegroups.com</a>.<br></blockquote></div></div><div dir=3D"auto"><br>=
</div><div dir=3D"auto">Hello,</div><div dir=3D"auto"><br></div><div dir=3D=
"auto">No you can&#39;t. The good news is that you hardly ever need it. Jus=
t return and continue execution from the callback function. The way typical=
 for _modeless_ dialogs.</div><div dir=3D"auto"><br></div><div dir=3D"auto"=
>Regards,</div><div dir=3D"auto">Matvey</div><div dir=3D"auto"><div class=
=3D"gmail_quote gmail_quote_container"><blockquote class=3D"gmail_quote" st=
yle=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>

<p></p>

-- <br />
-- <br />
You received this message from the &quot;vim_use&quot; maillist.<br />
Do not top-post! Type your reply below the text you are replying to.<br />
For more information, visit <a href=3D"http://www.vim.org/maillist.php">htt=
p://www.vim.org/maillist.php</a><br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;vim_use&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:[email protected]">vim_use+uns=
[email protected]</a>.<br />
To view this discussion visit <a href=3D"https://groups.google.com/d/msgid/=
vim_use/CAFsTB%2B%2B32J5Qe4eLLhN3QighXUS8KxT%2BsEv%3DkUDOx7OtLCYqGQ%40mail.=
gmail.com?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.com=
/d/msgid/vim_use/CAFsTB%2B%2B32J5Qe4eLLhN3QighXUS8KxT%2BsEv%3DkUDOx7OtLCYqG=
Q%40mail.gmail.com</a>.<br />

--000000000000a6128b064c477ef9--