[vim/vim] cannot use vim9 block inside nested autocmd (Issue #20918)
lacygoill (Vim Github Repository) <[email protected]> Sun, 02 Aug 2026 05:25:25 -0700
| Newsgroups | gmane.editors.vim.devel |
|---|---|
| Message-ID | <vim/vim/issues/[email protected]> |
----==_mimepart_6a6f3735834b6_e011606523547
Content-Type: text/plain; charset="UTF-8"
lacygoill created an issue (vim/vim#20918)
**Steps to reproduce**
Run this shell command:
vim -Nu NONE -S <(tee <<'EOF'
vim9script
autocmd FileType fzf autocmd BufWinEnter * ++once {
autocmd SafeState * ++once if true
| echo
| endif
}
EOF
)
An error is given:
E1128: } without {: }
**Expected behavior**
No error is given.
**Version of Vim**
9.2 Included patches: 1-894
**Environment**
Operating system: Debian GNU/Linux 13 (trixie)
Terminal: XTerm(398)
Value of $TERM: xterm-256color
Shell: GNU bash, version 5.2.37
**Additional context**
This works:
vim9script
autocmd BufWinEnter * ++once {
autocmd SafeState * ++once if true
| echo
| endif
}
---
It's a regression because the original code used to work a long time ago.
But I don't know when it broke, and I can't bisect the issue because I can't compile old Vim versions.
When I try, I get this error:
checking for tgetent()... configure: error: NOT FOUND!
You need to install a terminal library; for example ncurses.
Or specify the name of the library with --with-tlib.
Which I don't understand, because I have `libncurses-dev` installed.
If someone could tell me how to compile old Vim versions, I could bisect the issue.
--
Reply to this email directly or view it on GitHub:
https://github.com/vim/vim/issues/20918
You are receiving this because you are subscribed to this thread.
Message ID: <vim/vim/issues/[email protected]>
--
--
You received this message from the "vim_dev" 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_dev" 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_dev/vim/vim/issues/20918%40github.com.
----==_mimepart_6a6f3735834b6_e011606523547
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div style=3D"display: flex; flex-wrap: wrap; white-space: pre-wrap; align-=
items: center; "><img height=3D"20" width=3D"20" style=3D"border-radius:50%=
; margin-right: 4px;" decoding=3D"async" src=3D"https://avatars.githubuserc=
ontent.com/u/8505073" /><strong>lacygoill</strong> created an issue <a href=
=3D"https://github.com/vim/vim/issues/20918">(vim/vim#20918)</a></div>
<p dir=3D"auto"><strong>Steps to reproduce</strong></p>
<p dir=3D"auto">Run this shell command:</p>
<pre class=3D"notranslate"><code class=3D"notranslate">vim -Nu NONE -S <=
(tee <<'EOF'
vim9script
autocmd FileType fzf autocmd BufWinEnter * ++once {
autocmd SafeState * ++once if true
| echo
| endif
}
EOF
)
</code></pre>
<p dir=3D"auto">An error is given:</p>
<pre class=3D"notranslate"><code class=3D"notranslate">E1128: } without {: =
}
</code></pre>
<p dir=3D"auto"><strong>Expected behavior</strong></p>
<p dir=3D"auto">No error is given.</p>
<p dir=3D"auto"><strong>Version of Vim</strong></p>
<p dir=3D"auto">9.2 Included patches: 1-894</p>
<p dir=3D"auto"><strong>Environment</strong></p>
<p dir=3D"auto">Operating system: Debian GNU/Linux 13 (trixie)<br>
Terminal: XTerm(398)<br>
Value of $TERM: xterm-256color<br>
Shell: GNU bash, version 5.2.37</p>
<p dir=3D"auto"><strong>Additional context</strong></p>
<p dir=3D"auto">This works:</p>
<pre class=3D"notranslate"><code class=3D"notranslate">vim9script
autocmd BufWinEnter * ++once {
autocmd SafeState * ++once if true
| echo
| endif
}
</code></pre>
<hr>
<p dir=3D"auto">It's a regression because the original code used to work a =
long time ago.<br>
But I don't know when it broke, and I can't bisect the issue because I can'=
t compile old Vim versions.<br>
When I try, I get this error:</p>
<pre class=3D"notranslate"><code class=3D"notranslate">checking for tgetent=
()... configure: error: NOT FOUND!
You need to install a terminal library; for example ncurses.
Or specify the name of the library with --with-tlib.
</code></pre>
<p dir=3D"auto">Which I don't understand, because I have <code class=3D"not=
ranslate">libncurses-dev</code> installed.</p>
<p dir=3D"auto">If someone could tell me how to compile old Vim versions, I=
could bisect the issue.</p>
<p style=3D"font-size:small;-webkit-text-size-adjust:none;color:#666;">&mda=
sh;<br />Reply to this email directly, <a href=3D"https://github.com/vim/vi=
m/issues/20918">view it on GitHub</a>, or <a href=3D"https://github.com/not=
ifications/unsubscribe-auth/ACY5DGDXGT6PRFV75LSJQ6L5H4XLLAVCNFSNUABEKJSXA33=
TNF2G64TZHM2DAOJZG42DQMR3JFZXG5LFHM2TANBSGM3TIMBTG2QXMAQ">unsubscribe</a>.<=
br />Triage notifications, keep track of coding agent tasks and review pull=
requests on the go with GitHub Mobile for <a href=3D"https://github.com/no=
tifications/mobile/ios/ACY5DGGXW7W4MW5AC7JI2OT5H4XLLA5CNFSL4Z3JMQ5C6L3HNF2C=
22DVMIXUS43TOVSS6NJQGQZDGNZUGAZTNJTSMVQXG33OVJZXKYTTMNZGSYTFMSSWK5TFNZ2KUZT=
PN52GK4S7NFXXG">iOS</a> and <a href=3D"https://github.com/notifications/mob=
ile/android/ACY5DGEJPPXEHLQBNBC6IST5H4XLLA5CNFSL4Z3JMQ5C6L3HNF2C22DVMIXUS43=
TOVSS6NJQGQZDGNZUGAZTNJTSMVQXG33OVJZXKYTTMNZGSYTFMSSWK5TFNZ2K4ZTPN52GK4S7MF=
XGI4TPNFSA">Android</a>. Download it today!
<br />You are receiving this because you are subscribed to this thread.<img=
src=3D"https://github.com/notifications/beacon/ACY5DGDLEUIWY33HD2MUNOL5H4X=
LLBFCNFSM6AAAAAC4WW6XHCWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHQAA=
AAAEWIZBMUUZZGKYLTN5XKU43VMJZWG4TJMJSWI.gif" height=3D"1" width=3D"1" alt=
=3D"" /><span style=3D"color: transparent; font-size: 0; display: none; vis=
ibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-wid=
th: 0; max-height: 0; mso-hide: all">Message ID: <span><vim/vim/issues/2=
0918</span><span>@</span><span>github</span><span>.</span><span>com></sp=
an></span></p>
<script type=3D"application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/vim/vim/issues/20918",
"url": "https://github.com/vim/vim/issues/20918",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>
<p></p>
-- <br />
-- <br />
You received this message from the "vim_dev" 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_dev" 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_dev+uns=
[email protected]</a>.<br />
To view this discussion visit <a href=3D"https://groups.google.com/d/msgid/=
vim_dev/vim/vim/issues/20918%40github.com?utm_medium=3Demail&utm_source=3Df=
ooter">https://groups.google.com/d/msgid/vim_dev/vim/vim/issues/20918%40git=
hub.com</a>.<br />
----==_mimepart_6a6f3735834b6_e011606523547--