vim9script timer_start(0, (_) => { const d = { 'foo': {'bar': 'baz'} } })
vim --clean foo.vim:source %The script runs without error.
9.2.0780
https://github.com/vim/vim-win32-installer/releases/download/v9.2.0780/gvim_9.2.0780_x64.exe
Error detected while compiling C:/Users/bennyyip/foo.vim[6]..function <lambda>81: line 2: E723: Missing end of Dictionary '}': [end of lines] Error detected while processing C:/Users/bennyyip/foo.vim: line 7: E116: Invalid arguments for function timer_start(0, (_) => {
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
vim9script
timer_start(0, (_) => {
const d = {
'foo': {'bar': 'baz'}}
})
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
*command-block* *E1026* 定义用户命令时也可用代码块。在代码块内使用 Vim9 语法。 这里是个使用嵌入文档 (here-docs) 的例子: > com SomeCommand { g:someVar =<< trim eval END ccc ddd END } 如果语句包含字典,其结束花括号不能写在行首。否则,被解析为代码块的结束。下面这 样不行: > command NewCommand { g:mydict = { 'key': 'value', } # 错误: 会识别为代码块的结束 } 把 '}' 放在最后项目之后可以解决这个问题: > command NewCommand { g:mydict = { 'key': 'value' } } 理据: "}" 不能在命令之后出现,因为需要对命令进行解析才能找到它。为了一致起见, "{" 之后也不能跟随命令。不幸的是,这就意味着不接受 "() => { command }",必须 使用换行。 *vim9-curly* 为了不让字典常量的 "{" 被识别为语句块,把它包围在括号里: > var Lambda = (arg) => ({key: 42}) 和命令块的开始有歧义的话也是如此: > ({ key: value })->method() >
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
But this is a lambda, not a command block.
Rationale: The "}" cannot be after a command because it would require parsing
the commands to find it. For consistency with that no command can follow the
"{". Unfortunately this means using "() => { command }" does not work, line
breaks are always required.
The lambda body should be parsed, right?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
The lambda body should be parsed, right?
I hope so too, but I suspect the answer isn't optimistic.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
I would love this to be fixed as well, if it is possible.
I always forget where to put the ending }.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
This is a duplicate issue. Ref: #9352. @bennyyip I think you may should close this issue.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()