Mercurial > vim
comparison runtime/doc/vim9.txt @ 26591:3a63b1e4a6f4
Update runtime files
Commit: https://github.com/vim/vim/commit/0e6adf8a29d5c2c96c42cc7157f71bf22c2ad471
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Dec 16 14:41:10 2021 +0000
Update runtime files
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 16 Dec 2021 15:45:05 +0100 |
parents | c725b8e17f1f |
children | 2586659245db |
comparison
equal
deleted
inserted
replaced
26590:9eb413075ee4 | 26591:3a63b1e4a6f4 |
---|---|
1 *vim9.txt* For Vim version 8.2. Last change: 2021 Dec 01 | 1 *vim9.txt* For Vim version 8.2. Last change: 2021 Dec 15 |
2 | 2 |
3 | 3 |
4 VIM REFERENCE MANUAL by Bram Moolenaar | 4 VIM REFERENCE MANUAL by Bram Moolenaar |
5 | 5 |
6 | 6 |
566 var d = mapnew(dict, (k, v): string => { | 566 var d = mapnew(dict, (k, v): string => { |
567 return 'value' | 567 return 'value' |
568 }) | 568 }) |
569 No command can follow the "{", only a comment can be used there. | 569 No command can follow the "{", only a comment can be used there. |
570 | 570 |
571 If the statements include a dictionary, its closing bracket must not be | |
572 written at the start of a line. Otherwise, it would be parsed as the end of | |
573 the block. This does not work: > | |
574 command NewCommand { | |
575 let g:mydict = { | |
576 'key': 'value', | |
577 } # ERROR: will be recognized as the end of the block | |
578 } | |
579 Put the '}' after the last item to avoid this: > | |
580 command NewCommand { | |
581 let g:mydict = { | |
582 'key': 'value' } | |
583 } | |
584 | |
571 Rationale: The "}" cannot be after a command because it would require parsing | 585 Rationale: The "}" cannot be after a command because it would require parsing |
572 the commands to find it. For consistency with that no command can follow the | 586 the commands to find it. For consistency with that no command can follow the |
573 "{". Unfortunately this means using "() => { command }" does not work, line | 587 "{". Unfortunately this means using "() => { command }" does not work, line |
574 breaks are always required. | 588 breaks are always required. |
575 | 589 |