Mercurial > vim
diff runtime/doc/vim9.txt @ 20023:c85d4e173cc9 v8.2.0567
patch 8.2.0567: Vim9: cannot put comments halfway expressions
Commit: https://github.com/vim/vim/commit/2c330432cfb12181c61d698b5459bfd73d2610df
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Apr 13 14:41:35 2020 +0200
patch 8.2.0567: Vim9: cannot put comments halfway expressions
Problem: Vim9: cannot put comments halfway expressions.
Solution: Support # comments in many places.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 13 Apr 2020 14:45:04 +0200 |
parents | c001ee73519a |
children | bd021eb62e73 |
line wrap: on
line diff
--- a/runtime/doc/vim9.txt +++ b/runtime/doc/vim9.txt @@ -58,6 +58,15 @@ 2. Differences from legacy Vim script 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 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.