[vim/vim] Vim9: E488 when :command or :autocmd argument ends with "{" of a multi-line dict (after 9.2.0908) (Issue #21070)
Ryosuke Akiyama (Vim Github Repository) <[email protected]>
| Newsgroups | gmane.editors.vim.devel |
|---|---|
| Message-ID | <vim/vim/issues/[email protected]> |
kechako created an issue (vim/vim#21070)
### Steps to reproduce
1. Save the following as `repro.vim`:
```vim
vim9script
def Run(): void
command! -nargs=0 Foo call Bar('x', {
'key': 'value',
})
enddef
Run()
echo 'OK'
```
2. Run `vim -N -u NONE -S repro.vim`
3. `E488: Trailing characters: : 'value',` is reported instead of `OK`.
4. The same happens with `:autocmd` in place of `:command`, and at Vim9 script level as well as inside a `:def` function:
```vim
vim9script
autocmd BufWritePre *.go call Bar('x', {
'key': 'value',
})
```
These variants are **not** affected — the dict closed on the same line, and legacy script with line continuation:
```vim
command! -nargs=0 Foo call Bar('x', {'key': 'value'})
```
```vim
" legacy script
command! -nargs=0 Foo call Bar('x', {
\ 'key': 'value',
\ })
```
### Expected behaviour
`OK` is echoed and the user command is defined.
This works as expected in v9.2.0907, and fails from v9.2.0908 through v9.2.0958, including the current master (`4e0cd139c`).
### Version of Vim
9.2.0958
### Environment
Operating system: macOS 26.5.2 (arm64)
Terminal: Ghostty
Value of $TERM: xterm-ghostty
Shell: zsh 5.9
### Logs and stack traces
```shell
```
--
Reply to this email directly or view it on GitHub:
https://github.com/vim/vim/issues/21070
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/21070%40github.com.