diff options
author | Bram Moolenaar <Bram@vim.org> | 2023-02-20 20:44:55 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2023-02-20 20:44:55 +0000 |
commit | 938ae280c79b8cdb0fca60336ec4c090ecd8bb5a (patch) | |
tree | c9418dcff4d627d7c86aa740a47082f02ad555f6 /runtime/doc/vim9.txt | |
parent | 6b066c6d8f57aa05f1ab29ab4d098bc4bfabb1bb (diff) |
Update runtime files.
Diffstat (limited to 'runtime/doc/vim9.txt')
-rw-r--r-- | runtime/doc/vim9.txt | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/runtime/doc/vim9.txt b/runtime/doc/vim9.txt index eb26982cae..c6c04a9856 100644 --- a/runtime/doc/vim9.txt +++ b/runtime/doc/vim9.txt @@ -113,7 +113,7 @@ script and `:def` functions; details are below: :%s/this/that - Executing a register with "@r" does not work, you can prepend a colon or use `:exe`: > - :exe @a + :exe @a - Unless mentioned specifically, the highest |scriptversion| is used. - When defining an expression mapping, the expression will be evaluated in the context of the script where it was defined. @@ -622,7 +622,7 @@ Additionally, a lambda can contain statements in {}: > } This can be useful for a timer, for example: > var count = 0 - var timer = timer_start(500, (_) => { + var timer = timer_start(500, (_) => { count += 1 echom 'Handler called ' .. count }, {repeat: 3}) @@ -824,7 +824,7 @@ White space is required around most operators. White space is required in a sublist (list slice) around the ":", except at the start and end: > - otherlist = mylist[v : count] # v:count has a different meaning + otherlist = mylist[v : count] # v:count has a different meaning otherlist = mylist[:] # make a copy of the List otherlist = mylist[v :] otherlist = mylist[: v] @@ -879,7 +879,7 @@ This works for alphanumeric characters, underscore and dash. If you want to use another character, use a single or double quoted string: > var dict = {'key with space': value} var dict = {"key\twith\ttabs": value} - var dict = {'': value} # empty key + var dict = {'': value} # empty key < *E1139* In case the key needs to be an expression, square brackets can be used, just like in JavaScript: > @@ -1402,7 +1402,7 @@ to a Vim9 function: echo line(1) .. line(2) - line continuation does not always require a backslash: > - echo ['one', + echo ['one', \ 'two', \ 'three' \ ] |