summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-04-13 14:41:35 +0200
committerBram Moolenaar <Bram@vim.org>2020-04-13 14:41:35 +0200
commit2c330432cfb12181c61d698b5459bfd73d2610df (patch)
tree86e70718a23762d23c42fd292a623efed66205b2 /runtime
parent1a2f4bf6c80d750615f19c34e5baddd21310c9c9 (diff)
downloadvim-git-2c330432cfb12181c61d698b5459bfd73d2610df.tar.gz
patch 8.2.0567: Vim9: cannot put comments halfway expressionsv8.2.0567
Problem: Vim9: cannot put comments halfway expressions. Solution: Support # comments in many places.
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/vim9.txt12
1 files changed, 12 insertions, 0 deletions
diff --git a/runtime/doc/vim9.txt b/runtime/doc/vim9.txt
index 88c35deff..dd2d51056 100644
--- a/runtime/doc/vim9.txt
+++ b/runtime/doc/vim9.txt
@@ -58,6 +58,15 @@ old scripts, they keep working as before.
THIS IS STILL UNDER DEVELOPMENT - ANYTHING CAN BREAK - ANYTHING CAN CHANGE
+Comments starting with # ~
+
+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 #. Normally this is a command to list text with
+numbers, but you can also use `:number` for that. >
+ let count = 0 # number of occurences of Ni!
+
+
Vim9 functions ~
`:def` has no extra arguments like `:function` does: "range", "abort", "dict"
@@ -241,6 +250,9 @@ Vim9 script enforces proper use of white space. This is no longer allowed: >
let var =234 " Error!
There must be white space before and after the "=": >
let var = 234 " OK
+White space must also be put before the # that starts a comment: >
+ let var = 234# Error!
+ let var = 234 # OK
White space is required around most operators.