Re: Does popup_menu() functions asynchronous?

Piotr KolasiƄski <[email protected]> Mon, 16 Mar 2026 08:54:27 -0700 (PDT)
Newsgroups gmane.editors.vim
Message-ID <[email protected]>
------=_Part_527316_867735129.1773676467555
Content-Type: multipart/alternative; 
	boundary="----=_Part_527317_1748764784.1773676467555"

------=_Part_527317_1748764784.1773676467555
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable


Thanks for the response, but I=E2=80=99m afraid that I don=E2=80=99t unders=
tand what you=20
suggest. Could you be so kind and show me simple example.
Piotr
czwartek, 5 marca 2026 o 15:10:21 UTC+1 M napisa=C5=82(a):

>
>
> =D0=B2=D1=82, 3 =D0=BC=D0=B0=D1=80. 2026 =D0=B3., 11:41 Piotr Kolasi=C5=
=84ski <[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 fini=
sh the=20
>> call.=20
>> Does popup_menu works asynchronous? How can I execute such code in linea=
r=20
>> way?
>>
>> Piotr
>>
>> --=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 Group=
s=20
>> "vim_use" group.
>> To unsubscribe from this group and stop receiving emails from it, send a=
n=20
>> email to [email protected].
>> To view this discussion visit=20
>> https://groups.google.com/d/msgid/vim_use/78474f86-0bd6-401c-bdc3-fc85b4=
ca7b45n%40googlegroups.com=20
>> <https://groups.google.com/d/msgid/vim_use/78474f86-0bd6-401c-bdc3-fc85b=
4ca7b45n%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=
=20
> and continue execution from the callback function. The way typical for=20
> _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/861=
13ba2-911b-4ce2-ad3d-cecfa9f368b2n%40googlegroups.com.

------=_Part_527317_1748764784.1773676467555
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<br />Thanks for the response, but I=E2=80=99m afraid that I don=E2=80=99t =
understand what you suggest. Could you be so kind and show me simple exampl=
e.<div>Piotr</div><div class=3D"gmail_quote"><div dir=3D"auto" class=3D"gma=
il_attr">czwartek, 5 marca 2026 o=C2=A015:10:21 UTC+1 M napisa=C5=82(a):<br=
/></div><blockquote class=3D"gmail_quote" style=3D"margin: 0 0 0 0.8ex; bor=
der-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div dir=3D"aut=
o"><div><br><br><div class=3D"gmail_quote"><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 data-email-masked rel=3D"nofollow">[email protected]</=
a>&gt;:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8=
ex;border-left:1px #ccc solid;padding-left:1ex"></blockquote></div></div></=
div><div dir=3D"auto"><div><div class=3D"gmail_quote"><blockquote class=3D"=
gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-=
left:1ex">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 ec=
ho &quot;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;], #{ callb=
ack: &#39;PopupResult&#39; })</div><div><br></div><div>echo &#39;After popu=
p&#39;</div><div><br></div><div>=E2=80=94=E2=80=94-</div><div><br></div><di=
v>but &#39;After popup=E2=80=99 is displayed immediately, not waiting for f=
inish the call.=C2=A0</div><div>Does popup_menu works asynchronous? How can=
 I execute such code in linear way?</div><div><br></div><div>Piotr</div>

<p></p></blockquote></div></div></div><div dir=3D"auto"><div><div class=3D"=
gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;b=
order-left:1px #ccc solid;padding-left:1ex">

-- <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" rel=
=3D"noreferrer nofollow" target=3D"_blank" data-saferedirecturl=3D"https://=
www.google.com/url?hl=3Dpl&amp;q=3Dhttp://www.vim.org/maillist.php&amp;sour=
ce=3Dgmail&amp;ust=3D1773762630332000&amp;usg=3DAOvVaw0BrPWmzexS4JXJz3P_Jhj=
B">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 rel=3D"noreferrer nofollow" data-email-masked>vim_use+u...@=
googlegroups.com</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" rel=3D"noreferrer nofollow" target=3D"_bl=
ank" data-saferedirecturl=3D"https://www.google.com/url?hl=3Dpl&amp;q=3Dhtt=
ps://groups.google.com/d/msgid/vim_use/78474f86-0bd6-401c-bdc3-fc85b4ca7b45=
n%2540googlegroups.com?utm_medium%3Demail%26utm_source%3Dfooter&amp;source=
=3Dgmail&amp;ust=3D1773762630332000&amp;usg=3DAOvVaw09VcZmyageBd5L0NKmQTHy"=
>https://groups.google.com/d/msgid/vim_use/78474f86-0bd6-401c-bdc3-fc85b4ca=
7b45n%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 d=
ir=3D"auto">No you can&#39;t. The good news is that you hardly ever need it=
. Just return and continue execution from the callback function. The way ty=
pical 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 cl=
ass=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0=
 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>
</blockquote></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/86113ba2-911b-4ce2-ad3d-cecfa9f368b2n%40googlegroups.com?utm_medium=
=3Demail&utm_source=3Dfooter">https://groups.google.com/d/msgid/vim_use/861=
13ba2-911b-4ce2-ad3d-cecfa9f368b2n%40googlegroups.com</a>.<br />

------=_Part_527317_1748764784.1773676467555--

------=_Part_527316_867735129.1773676467555--