summaryrefslogtreecommitdiff
path: root/runtime/doc/vim9.txt
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-06-21 22:12:03 +0200
committerBram Moolenaar <Bram@vim.org>2020-06-21 22:12:03 +0200
commit73fef33014dbf21fc59e7e47fb091117868d82fb (patch)
tree23d165829a07994dd93c4993f54dfc5ce0fcaf5e /runtime/doc/vim9.txt
parent8d9437968b6693ecb14e7375bcb242e657e75266 (diff)
downloadvim-git-73fef33014dbf21fc59e7e47fb091117868d82fb.tar.gz
Update runtime files
Diffstat (limited to 'runtime/doc/vim9.txt')
-rw-r--r--runtime/doc/vim9.txt17
1 files changed, 12 insertions, 5 deletions
diff --git a/runtime/doc/vim9.txt b/runtime/doc/vim9.txt
index 1f3f12060..9a40959e5 100644
--- a/runtime/doc/vim9.txt
+++ b/runtime/doc/vim9.txt
@@ -1,4 +1,4 @@
-*vim9.txt* For Vim version 8.2. Last change: 2020 Jun 14
+*vim9.txt* For Vim version 8.2. Last change: 2020 Jun 21
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -30,7 +30,7 @@ THIS IS STILL UNDER DEVELOPMENT - ANYTHING CAN BREAK - ANYTHING CAN CHANGE
Vim script has been growing over time, while preserving backwards
compatibility. That means bad choices from the past often can't be changed
-and compability with Vi restricts possible solutions. Execution is quite
+and compatibility with Vi restricts possible solutions. Execution is quite
slow, each line is parsed every time it is executed.
The main goal of Vim9 script is to drastically improve performance. This is
@@ -68,7 +68,7 @@ In Vim script comments normally start with double quote. That can also be the
start of a string, thus in many places it cannot be used. In Vim9 script a
comment can also start with #. In Vi this is a command to list text with
numbers, but you can also use `:number` for that. >
- let count = 0 # number of occurences
+ let count = 0 # number of occurrences
To improve readability there must be a space between the command and the #
that starts a comment. Note that #{ is the start of a dictionary, therefore
@@ -269,6 +269,13 @@ possible AFTER the operators. For example: >
PosFunc(arg) :
NegFunc(arg)
+A special case is "->" for function call chains, it can appear in the next
+line: >
+ let result = GetBuilder()
+ ->BuilderSetWidth(333)
+ ->BuilderSetHeight(777)
+ ->BuilderBuild()
+
Note that "enddef" cannot be used at the start of a continuation line, it ends
the current function.
@@ -566,7 +573,7 @@ defined (otherwise script-local) items: >
Import ~
- *:import* *:imp*
+ *:import* *:imp* *E1094*
The exported items can be imported individually in another Vim9 script: >
import EXPORTED_CONST from "thatscript.vim"
import MyClass from "myclass.vim"
@@ -692,7 +699,7 @@ A, B and C, where A calls B, B calls C, and C calls A again. It's impossible
to reorder the functions to avoid forward references.
An alternative would be to first scan through the file to locate items and
-figure out their type, so that forward refeferences are found, and only then
+figure out their type, so that forward references are found, and only then
execute the script and compile the functions. This means the script has to be
parsed twice, which is slower, and some conditions at the script level, such
as checking if a feature is supported, are hard to use. An attempt was made