0
0
mirror of https://github.com/vim/vim.git synced 2025-07-25 10:54:51 -04:00

Update runtime files

This commit is contained in:
Bram Moolenaar 2020-07-10 22:00:53 +02:00
parent a7eedf317a
commit 7ff78465f7
21 changed files with 690 additions and 420 deletions

View File

@ -1,15 +1,11 @@
" Vim script to download a missing spell file " Vim script to download a missing spell file
" Maintainer: Bram Moolenaar <Bram@vim.org> " Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2012 Jan 08 " Last Change: 2020 Jul 10
if !exists('g:spellfile_URL') if !exists('g:spellfile_URL')
" Prefer using http:// when netrw should be able to use it, since " Always use https:// because it's secure. The certificate is for nluug.nl,
" more firewalls let this through. " thus we can't use the alias ftp.vim.org here.
if executable("curl") || executable("wget") || executable("fetch") let g:spellfile_URL = 'https://ftp.nluug.nl/pub/vim/runtime/spell'
let g:spellfile_URL = 'http://ftp.vim.org/pub/vim/runtime/spell'
else
let g:spellfile_URL = 'ftp://ftp.vim.org/pub/vim/runtime/spell'
endif
endif endif
let s:spellfile_URL = '' " Start with nothing so that s:donedict is reset. let s:spellfile_URL = '' " Start with nothing so that s:donedict is reset.

View File

@ -1,4 +1,4 @@
*channel.txt* For Vim version 8.2. Last change: 2020 Jun 01 *channel.txt* For Vim version 8.2. Last change: 2020 Jul 10
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -1259,7 +1259,7 @@ can start typing a line.
The text of the prompt can be set with the |prompt_setprompt()| function. The text of the prompt can be set with the |prompt_setprompt()| function.
The user can go to Normal mode and navigate through the buffer. This can be The user can go to Normal mode and navigate through the buffer. This can be
useful see older output or copy text. useful to see older output or copy text.
The CTRL-W key can be used to start a window command, such as CTRL-W w to The CTRL-W key can be used to start a window command, such as CTRL-W w to
switch to the next window. This also works in Insert mode (use Shift-CTRL-W switch to the next window. This also works in Insert mode (use Shift-CTRL-W

View File

@ -1,4 +1,4 @@
*editing.txt* For Vim version 8.2. Last change: 2020 Jun 05 *editing.txt* For Vim version 8.2. Last change: 2020 Jul 05
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -1402,7 +1402,7 @@ to 0, 'modeline' off, 'expandtab' off). Setting the 'binary' option has the
same effect. Don't forget to do this before reading the file. same effect. Don't forget to do this before reading the file.
There are a few things to remember when editing binary files: There are a few things to remember when editing binary files:
- When editing executable files the number of characters must not change. - When editing executable files the number of bytes must not change.
Use only the "R" or "r" command to change text. Do not delete characters Use only the "R" or "r" command to change text. Do not delete characters
with "x" or by backspacing. with "x" or by backspacing.
- Set the 'textwidth' option to 0. Otherwise lines will unexpectedly be - Set the 'textwidth' option to 0. Otherwise lines will unexpectedly be
@ -1410,7 +1410,7 @@ There are a few things to remember when editing binary files:
- When there are not many <EOL>s, the lines will become very long. If you - When there are not many <EOL>s, the lines will become very long. If you
want to edit a line that does not fit on the screen reset the 'wrap' option. want to edit a line that does not fit on the screen reset the 'wrap' option.
Horizontal scrolling is used then. If a line becomes too long (more than Horizontal scrolling is used then. If a line becomes too long (more than
about 32767 characters on the Amiga, much more on 32-bit systems, see about 32767 bytes on the Amiga, much more on 32-bit and 64-bit systems, see
|limits|) you cannot edit that line. The line will be split when reading |limits|) you cannot edit that line. The line will be split when reading
the file. It is also possible that you get an "out of memory" error when the file. It is also possible that you get an "out of memory" error when
reading the file. reading the file.

View File

@ -1,4 +1,4 @@
*eval.txt* For Vim version 8.2. Last change: 2020 Jun 30 *eval.txt* For Vim version 8.2. Last change: 2020 Jul 09
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -3036,7 +3036,8 @@ append({lnum}, {text}) *append()*
:let failed = append(line('$'), "# THE END") :let failed = append(line('$'), "# THE END")
:let failed = append(0, ["Chapter 1", "the beginning"]) :let failed = append(0, ["Chapter 1", "the beginning"])
< Can also be used as a |method| after a List: > < Can also be used as a |method| after a List, the base is
passed as the second argument: >
mylist->append(lnum) mylist->append(lnum)
@ -3058,7 +3059,8 @@ appendbufline({expr}, {lnum}, {text}) *appendbufline()*
error message is given. Example: > error message is given. Example: >
:let failed = appendbufline(13, 0, "# THE START") :let failed = appendbufline(13, 0, "# THE START")
< <
Can also be used as a |method| after a List: > < Can also be used as a |method| after a List, the base is
passed as the second argument: >
mylist->appendbufline(buf, lnum) mylist->appendbufline(buf, lnum)
@ -3902,6 +3904,7 @@ deepcopy({expr} [, {noref}]) *deepcopy()* *E698*
changing an item in the copy does not change the contents of changing an item in the copy does not change the contents of
the original |List|. the original |List|.
A |Dictionary| is copied in a similar way as a |List|. A |Dictionary| is copied in a similar way as a |List|.
When {noref} is omitted or zero a contained |List| or When {noref} is omitted or zero a contained |List| or
|Dictionary| is only copied once. All references point to |Dictionary| is only copied once. All references point to
this single copy. With {noref} set to 1 every occurrence of a this single copy. With {noref} set to 1 every occurrence of a
@ -4838,12 +4841,14 @@ get({list}, {idx} [, {default}]) *get()*
Get item {idx} from |List| {list}. When this item is not Get item {idx} from |List| {list}. When this item is not
available return {default}. Return zero when {default} is available return {default}. Return zero when {default} is
omitted. omitted.
Can also be used as a |method|: > Preferably used as a |method|: >
mylist->get(idx) mylist->get(idx)
get({blob}, {idx} [, {default}]) get({blob}, {idx} [, {default}])
Get byte {idx} from |Blob| {blob}. When this byte is not Get byte {idx} from |Blob| {blob}. When this byte is not
available return {default}. Return -1 when {default} is available return {default}. Return -1 when {default} is
omitted. omitted.
Preferably used as a |method|: >
myblob->get(idx)
get({dict}, {key} [, {default}]) get({dict}, {key} [, {default}])
Get item with key {key} from |Dictionary| {dict}. When this Get item with key {key} from |Dictionary| {dict}. When this
item is not available return {default}. Return zero when item is not available return {default}. Return zero when
@ -4851,6 +4856,8 @@ get({dict}, {key} [, {default}])
let val = get(g:, 'var_name', 'default') let val = get(g:, 'var_name', 'default')
< This gets the value of g:var_name if it exists, and uses < This gets the value of g:var_name if it exists, and uses
'default' when it does not exist. 'default' when it does not exist.
Preferably used as a |method|: >
mydict->get(key)
get({func}, {what}) get({func}, {what})
Get an item with from Funcref {func}. Possible values for Get an item with from Funcref {func}. Possible values for
{what} are: {what} are:
@ -4858,7 +4865,9 @@ get({func}, {what})
"func" The function "func" The function
"dict" The dictionary "dict" The dictionary
"args" The list with arguments "args" The list with arguments
Preferably used as a |method|: >
myfunc->get(what)
<
*getbufinfo()* *getbufinfo()*
getbufinfo([{expr}]) getbufinfo([{expr}])
getbufinfo([{dict}]) getbufinfo([{dict}])
@ -9013,6 +9022,8 @@ setloclist({nr}, {list} [, {action} [, {what}]]) *setloclist()*
Otherwise, same as |setqflist()|. Otherwise, same as |setqflist()|.
Also see |location-list|. Also see |location-list|.
For {action} see |setqflist-action|.
If the optional {what} dictionary argument is supplied, then If the optional {what} dictionary argument is supplied, then
only the items listed in {what} are set. Refer to |setqflist()| only the items listed in {what} are set. Refer to |setqflist()|
for the list of supported keys in {what}. for the list of supported keys in {what}.
@ -9091,7 +9102,7 @@ setqflist({list} [, {action} [, {what}]]) *setqflist()*
only the items listed in {what} are set. The first {list} only the items listed in {what} are set. The first {list}
argument is ignored. See below for the supported items in argument is ignored. See below for the supported items in
{what}. {what}.
*setqflist-what*
When {what} is not present, the items in {list} or used. Each When {what} is not present, the items in {list} or used. Each
item must be a dictionary. Non-dictionary items in {list} are item must be a dictionary. Non-dictionary items in {list} are
ignored. Each dictionary item can contain the following ignored. Each dictionary item can contain the following
@ -9128,7 +9139,7 @@ setqflist({list} [, {action} [, {what}]]) *setqflist()*
Note that the list is not exactly the same as what Note that the list is not exactly the same as what
|getqflist()| returns. |getqflist()| returns.
{action} values: *E927* {action} values: *setqflist-action* *E927*
'a' The items from {list} are added to the existing 'a' The items from {list} are added to the existing
quickfix list. If there is no existing list, then a quickfix list. If there is no existing list, then a
new list is created. new list is created.

View File

@ -1,4 +1,4 @@
*options.txt* For Vim version 8.2. Last change: 2020 Jun 10 *options.txt* For Vim version 8.2. Last change: 2020 Jul 05
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar

View File

@ -1,4 +1,4 @@
*pattern.txt* For Vim version 8.2. Last change: 2019 Dec 07 *pattern.txt* For Vim version 8.2. Last change: 2020 Jul 10
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -1279,7 +1279,7 @@ not match in "càt" (where the a has the composing character 0x0300), but
0xe1, it does not have a compositing character). It does match "cat" (where 0xe1, it does not have a compositing character). It does match "cat" (where
the a is just an a). the a is just an a).
When a composing character appears at the start of the pattern of after an When a composing character appears at the start of the pattern or after an
item that doesn't include the composing character, a match is found at any item that doesn't include the composing character, a match is found at any
character that includes this composing character. character that includes this composing character.

View File

@ -1,4 +1,4 @@
*spell.txt* For Vim version 8.2. Last change: 2020 Jun 10 *spell.txt* For Vim version 8.2. Last change: 2020 Jul 10
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -653,11 +653,12 @@ ask you where to write the file (there must be a writable directory in
'runtimepath' for this). 'runtimepath' for this).
The plugin has a default place where to look for spell files, on the Vim ftp The plugin has a default place where to look for spell files, on the Vim ftp
server. If you want to use another location or another protocol, set the server. The protocol used is SSL (https://) for security. If you want to use
g:spellfile_URL variable to the directory that holds the spell files. The another location or another protocol, set the g:spellfile_URL variable to the
|netrw| plugin is used for getting the file, look there for the specific directory that holds the spell files. You can use http:// or ftp://, but you
syntax of the URL. Example: > are taking a security risk then. The |netrw| plugin is used for getting the
let g:spellfile_URL = 'http://ftp.vim.org/vim/runtime/spell' file, look there for the specific syntax of the URL. Example: >
let g:spellfile_URL = 'https://ftp.nluug.nl/vim/runtime/spell'
You may need to escape special characters. You may need to escape special characters.
The plugin will only ask about downloading a language once. If you want to The plugin will only ask about downloading a language once. If you want to

View File

@ -1,4 +1,4 @@
*syntax.txt* For Vim version 8.2. Last change: 2020 Jun 01 *syntax.txt* For Vim version 8.2. Last change: 2020 Jul 08
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -1403,7 +1403,7 @@ to your startup file.
EUPHORIA *euphoria3.vim* *euphoria4.vim* *ft-euphoria-syntax* EUPHORIA *euphoria3.vim* *euphoria4.vim* *ft-euphoria-syntax*
Two syntax highlighting files exists for Euphoria. One for Euphoria Two syntax highlighting files exist for Euphoria. One for Euphoria
version 3.1.1, which is the default syntax highlighting file, and one for version 3.1.1, which is the default syntax highlighting file, and one for
Euphoria version 4.0.5 or later. Euphoria version 4.0.5 or later.

View File

@ -4699,6 +4699,7 @@ E855 autocmd.txt /*E855*
E858 eval.txt /*E858* E858 eval.txt /*E858*
E859 eval.txt /*E859* E859 eval.txt /*E859*
E86 windows.txt /*E86* E86 windows.txt /*E86*
E860 textprop.txt /*E860*
E861 popup.txt /*E861* E861 popup.txt /*E861*
E862 eval.txt /*E862* E862 eval.txt /*E862*
E863 popup.txt /*E863* E863 popup.txt /*E863*
@ -8820,7 +8821,9 @@ setloclist() eval.txt /*setloclist()*
setmatches() eval.txt /*setmatches()* setmatches() eval.txt /*setmatches()*
setpos() eval.txt /*setpos()* setpos() eval.txt /*setpos()*
setqflist() eval.txt /*setqflist()* setqflist() eval.txt /*setqflist()*
setqflist-action eval.txt /*setqflist-action*
setqflist-examples quickfix.txt /*setqflist-examples* setqflist-examples quickfix.txt /*setqflist-examples*
setqflist-what eval.txt /*setqflist-what*
setreg() eval.txt /*setreg()* setreg() eval.txt /*setreg()*
settabvar() eval.txt /*settabvar()* settabvar() eval.txt /*settabvar()*
settabwinvar() eval.txt /*settabwinvar()* settabwinvar() eval.txt /*settabwinvar()*

View File

@ -1,4 +1,4 @@
*testing.txt* For Vim version 8.2. Last change: 2020 Jun 15 *testing.txt* For Vim version 8.2. Last change: 2020 Jul 09
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -264,7 +264,8 @@ assert_equal({expected}, {actual} [, {msg}])
< Will result in a string to be added to |v:errors|: < Will result in a string to be added to |v:errors|:
test.vim line 12: Expected 'foo' but got 'bar' ~ test.vim line 12: Expected 'foo' but got 'bar' ~
Can also be used as a |method|: > Can also be used as a |method|, the base is passed as the
second argument: >
mylist->assert_equal([1, 2, 3]) mylist->assert_equal([1, 2, 3])
< *assert_equalfile()* < *assert_equalfile()*

View File

@ -220,7 +220,7 @@ prop_list({lnum} [, {props}]) *prop_list()*
Can also be used as a |method|: > Can also be used as a |method|: >
GetLnum()->prop_list() GetLnum()->prop_list()
< <
*prop_remove()* *E968* *prop_remove()* *E968* *E860*
prop_remove({props} [, {lnum} [, {lnum-end}]]) prop_remove({props} [, {lnum} [, {lnum-end}]])
Remove a matching text property from line {lnum}. When Remove a matching text property from line {lnum}. When
{lnum-end} is given, remove matching text properties from line {lnum-end} is given, remove matching text properties from line

View File

@ -1,4 +1,4 @@
*todo.txt* For Vim version 8.2. Last change: 2020 Jun 28 *todo.txt* For Vim version 8.2. Last change: 2020 Jul 10
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -38,38 +38,22 @@ browser use: https://github.com/vim/vim/issues/1234
*known-bugs* *known-bugs*
-------------------- Known bugs and current work ----------------------- -------------------- Known bugs and current work -----------------------
Include src/po/vim.pot ?
Vim9 script:
- line continuation at script level:
eval_to_string_skip(), test with :throw
eval1_emsg(), pass "eap", test with :execute, :echomsg, :echoerr
handle_subscript() - call_func_rettv() - get_func_tv()
func(
args arg)
callers of get_func_tv():
eval_func()
ex_call()
function arguments, test assert_equal() with lambda, test :function
:import:
others
eval_index()
- test:
[1,
2,
3]->Func()
Making everything work: Making everything work:
- "nr += 4" gives "already defined" error.
- Error for "g:var: string = 'value'"
- Make func()->append('$') work - value is last argument, not first. #6305
- in Vim9 script expressions are evaluated differently, not using a type. - in Vim9 script expressions are evaluated differently, not using a type.
e.g. "'' == 0" does not give an error and evaluates to true. e.g. "'' == 0" does not give an error and evaluates to true.
- possible memory leak in test_vim9_func through compile_nested_function. - cannot put # comment after assert() in :def function
- memory leaks in test_vim9_expr
- memory leaks in test_vim9_script
- more return types depending on the first argument, like sort(). - more return types depending on the first argument, like sort().
- Check that when sourcing a Vim9 script, only the global items can be used. - Check that when sourcing a Vim9 script, only the global items can be used.
- :put with a "=" register argument doesn't work, need to find the expression
and compile it. (#6397)
- should "'text'->method()" work? 't is a range, but 'text isn't.
- Slice of list: [1, 2, 3][1:2].
- Give runtime error if function argument is wrong.
def Increment(nr: number)
range(3)->Increment()
- Expand `=expr` in :next, :argedit, :argadd, :argdelete, :drop
- Expand `=expr` in :vimgrep, :vimgrepadd, :lvimgrep, :lvimgrepadd
- Expand `=expr` in :mkspell
- Make "true" and "false" work in vim9script - Make "true" and "false" work in vim9script
- Test that a function defined inside a :def function is local to that - Test that a function defined inside a :def function is local to that
function, g: functions can be defined and script-local functions cannot be function, g: functions can be defined and script-local functions cannot be
@ -87,9 +71,10 @@ Making everything work:
- Compile redir to local variable: var_redir_start(). - Compile redir to local variable: var_redir_start().
- Compile builtin functions that access local variables: - Compile builtin functions that access local variables:
islocked() islocked()
- Expand `=expr` in :next, :argedit, :argadd, :argdelete, :drop - possible memory leak in test_vim9_func through compile_nested_function.
- Expand `=expr` in :vimgrep, :vimgrepadd, :lvimgrep, :lvimgrepadd - memory leaks in test_vim9_expr
- Expand `=expr` in :mkspell - memory leaks in test_vim9_script
- memory leaks in test_vim9_cmd
- When evaluating constants for script variables, some functions could work: - When evaluating constants for script variables, some functions could work:
has('asdf'), len('string') has('asdf'), len('string')
- Support type for ":let"/":const" at script level for Vim9 script. - Support type for ":let"/":const" at script level for Vim9 script.
@ -340,6 +325,9 @@ When changing the crypt key the buffer should be considered modified.
Like when changing 'fileformat'. Save the old key in save_file_ff(). Like when changing 'fileformat'. Save the old key in save_file_ff().
(Ninu-Ciprian Marginean) (Ninu-Ciprian Marginean)
Patch to implement the vimtutor with a plugin: #6414
Was originally writtten by Felipe Morales.
Strange sequence of BufWipeout and BufNew events while doing omni-complete. Strange sequence of BufWipeout and BufNew events while doing omni-complete.
(Paul Jolly, #5656) (Paul Jolly, #5656)
Get BufDelete without preceding BufNew. (Paul Jolly, #5694) Get BufDelete without preceding BufNew. (Paul Jolly, #5694)
@ -1074,7 +1062,7 @@ Problem with three-piece comment. (Michael Lee, 2017 May 11, #1696)
Creating a partial with an autoload function is confused about the "self" Creating a partial with an autoload function is confused about the "self"
attribute of the function. For an unknown function assume "self" and make attribute of the function. For an unknown function assume "self" and make
that optiona? (Bjorn Linse, 2017 Aug 5) that optional? (Bjorn Linse, 2017 Aug 5)
Cindent: returning a structure has more indent for the second item. Cindent: returning a structure has more indent for the second item.
(Sam Pagenkopf, 2017 Sep 14, #2090) (Sam Pagenkopf, 2017 Sep 14, #2090)

View File

@ -1,4 +1,4 @@
*usr_11.txt* For Vim version 8.2. Last change: 2020 Jan 17 *usr_11.txt* For Vim version 8.2. Last change: 2020 Jul 08
VIM USER MANUAL - by Bram Moolenaar VIM USER MANUAL - by Bram Moolenaar
@ -256,7 +256,7 @@ O Open the file readonly. Use this when you just want to view the file and
E Edit the file anyway. Use this with caution! If the file is being edited E Edit the file anyway. Use this with caution! If the file is being edited
in another Vim, you might end up with two versions of the file. Vim will in another Vim, you might end up with two versions of the file. Vim will
try to warn you when this happens, but better be safe then sorry. try to warn you when this happens, but better be safe than sorry.
R Recover the file from the swap file. Use this if you know that the swap R Recover the file from the swap file. Use this if you know that the swap
file contains changes that you want to recover. file contains changes that you want to recover.

View File

@ -1,4 +1,4 @@
*various.txt* For Vim version 8.2. Last change: 2020 May 30 *various.txt* For Vim version 8.2. Last change: 2020 Jul 10
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -754,7 +754,7 @@ up mappings to simulate the commands that less supports. Otherwise, you can
still use the Vim commands. still use the Vim commands.
This isn't perfect. For example, when viewing a short file Vim will still use This isn't perfect. For example, when viewing a short file Vim will still use
the whole screen. But it works good enough for most uses, and you get syntax the whole screen. But it works well enough for most uses, and you get syntax
highlighting. highlighting.
The "h" key will give you a short overview of the available commands. The "h" key will give you a short overview of the available commands.

View File

@ -1,4 +1,4 @@
*vim9.txt* For Vim version 8.2. Last change: 2020 Jun 24 *vim9.txt* For Vim version 8.2. Last change: 2020 Jul 10
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -64,16 +64,20 @@ THIS IS STILL UNDER DEVELOPMENT - ANYTHING CAN BREAK - ANYTHING CAN CHANGE
Comments starting with # ~ Comments starting with # ~
In Vim script comments normally start with double quote. That can also be the In Vim script comments start with double quote. That can also be the start of
start of a string, thus in many places it cannot be used. In Vim9 script a a string, thus in many places it cannot be used. In Vim9 script a comment
comment can also start with #. In Vi this is a command to list text with normally starts with #. In Vi this is a command to list text with numbers,
numbers, but you can also use `:number` for that. > but you can also use `:number` for that. >
let count = 0 # number of occurrences let count = 0 # number of occurrences
To improve readability there must be a space between the command and the # 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 that starts a comment. Note that #{ is the start of a dictionary, therefore
it cannot start a comment. it cannot start a comment.
Since Vim9 script allows for line breaks in many places, the double quoted
comment also cannot be used at the start of a line after an expression. To
avoid confusion it is best to only use # comments.
Vim9 functions ~ Vim9 functions ~
@ -276,10 +280,13 @@ possible just before or after the operator. For example: >
< *E1050* < *E1050*
To make it possible for the operator at the start of the line to be To make it possible for the operator at the start of the line to be
recognized, it is required to put a colon before a range. This will adde recognized, it is required to put a colon before a range. This will add
"start" and print: > "start" and print: >
let result = start let result = start
+ print + print
Like this: >
let result = start + print
This will assign "start" and print a line: > This will assign "start" and print a line: >
let result = start let result = start
:+ print :+ print
@ -291,8 +298,32 @@ arguments: >
separator = '-' separator = '-'
): string ): string
Note that "enddef" cannot be used at the start of a continuation line, it ends Notes:
the current function. - "enddef" cannot be used at the start of a continuation line, it ends the
current function.
- No line break is allowed in the LHS of an assignment. Specifically when
unpacking a list |:let-unpack|. This is OK: >
[var1, var2] =
Func()
< This does not work: >
[var1,
var2] =
Func()
- No line break is allowed in between arguments of an `:echo`, `:execute` and
similar commands. This is OK: >
echo [1,
2] [3,
4]
< This does not work: >
echo [1, 2]
[3, 4]
- No line break is allowed in the arguments of a lambda, between the "{" and
"->". This is OK: >
filter(list, {k, v ->
v > 0})
< This does not work: >
filter(list, {k,
v -> v > 0})
No curly braces expansion ~ No curly braces expansion ~
@ -318,7 +349,8 @@ Vim9 script enforces proper use of white space. This is no longer allowed: >
let var =234 " Error! let var =234 " Error!
There must be white space before and after the "=": > There must be white space before and after the "=": >
let var = 234 " OK let var = 234 " OK
White space must also be put before the # that starts a comment: > White space must also be put before the # that starts a comment after a
command: >
let var = 234# Error! let var = 234# Error!
let var = 234 # OK let var = 234 # OK
@ -479,6 +511,22 @@ prefix.
Note that for command line completion of {func} you Note that for command line completion of {func} you
can prepend "s:" to find script-local functions. can prepend "s:" to find script-local functions.
Limitations ~
Local variables will not be visible to string evaluation. For example: >
def EvalString(): list<string>
let list = ['aa', 'bb', 'cc', 'dd']
return range(1, 2)->map('list[v:val]')
enddef
The map argument is a string expression, which is evaluated without the
function scope. Instead, use a lambda: >
def EvalString(): list<string>
let list = ['aa', 'bb', 'cc', 'dd']
return range(1, 2)->map({ _, v -> list[v] })
enddef
============================================================================== ==============================================================================
4. Types *vim9-types* 4. Types *vim9-types*

View File

@ -1,7 +1,7 @@
" Vim filetype plugin " Vim filetype plugin
" Language: Vim " Language: Vim
" Maintainer: Bram Moolenaar <Bram@vim.org> " Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2020 Jun 16 " Last Change: 2020 Jul 06
" Only do this when not done yet for this buffer " Only do this when not done yet for this buffer
if exists("b:did_ftplugin") if exists("b:did_ftplugin")
@ -49,14 +49,14 @@ setlocal isk+=#
setlocal keywordprg=:help setlocal keywordprg=:help
" Set 'comments' to format dashed lists in comments " Set 'comments' to format dashed lists in comments
setlocal com=sO:\"\ -,mO:\"\ \ ,eO:\"\",:\" setlocal com=sO:\"\ -,mO:\"\ \ ,sO:#\ -,mO:#\ \ ,eO:##,:\",:#
" Format comments to be up to 78 characters long " Format comments to be up to 78 characters long
if &tw == 0 if &tw == 0
setlocal tw=78 setlocal tw=78
endif endif
" Comments start with a double quote " Comments start with a double quote; in Vim9 script # would also work
setlocal commentstring=\"%s setlocal commentstring=\"%s
if !exists("no_plugin_maps") && !exists("no_vim_maps") if !exists("no_plugin_maps") && !exists("no_vim_maps")

View File

@ -10,5 +10,5 @@ test:
VIMRUNTIME=$(VIMRUNTIME) $(VIM) --clean --not-a-term -u testdir/runtest.vim VIMRUNTIME=$(VIMRUNTIME) $(VIM) --clean --not-a-term -u testdir/runtest.vim
clean: clean testclean:
rm -f testdir/*.fail testdir/*.out rm -f testdir/*.fail testdir/*.out

View File

@ -1,9 +1,8 @@
" Vim indent script for HTML " Vim indent script for HTML
" Header: "{{{
" Maintainer: Bram Moolenaar " Maintainer: Bram Moolenaar
" Original Author: Andy Wokula <anwoku@yahoo.de> " Original Author: Andy Wokula <anwoku@yahoo.de>
" Last Change: 2020 Jun 18 " Last Change: 2020 Jul 06
" Version: 1.0 " Version: 1.0 "{{{
" Description: HTML indent script with cached state for faster indenting on a " Description: HTML indent script with cached state for faster indenting on a
" range of lines. " range of lines.
" Supports template systems through hooks. " Supports template systems through hooks.
@ -587,7 +586,7 @@ func! s:Alien3()
return eval(b:hi_js1indent) return eval(b:hi_js1indent)
endif endif
if b:hi_indent.scripttype == "javascript" if b:hi_indent.scripttype == "javascript"
return GetJavascriptIndent() return eval(b:hi_js1indent) + GetJavascriptIndent()
else else
return -1 return -1
endif endif

View File

@ -2,6 +2,16 @@
" START_INDENT " START_INDENT
<html>
<body>
<style>
div#d1 { color: red; }
div#d2 { color: green; }
</style>
<script>
var v1 = "v1";
var v2 = "v2";
</script>
<div> <div>
<div> <div>
text text
@ -32,5 +42,25 @@ dt text
</dt> </dt>
</dl> </dl>
</body>
</html>
" END_INDENT " END_INDENT
% START_INDENT
% INDENT_EXE let g:html_indent_style1 = "inc"
% INDENT_EXE let g:html_indent_script1 = "zero"
% INDENT_EXE call HtmlIndent_CheckUserSettings()
<html>
<body>
<style>
div#d1 { color: red; }
div#d2 { color: green; }
</style>
<script>
var v1 = "v1";
var v2 = "v2";
</script>
</body>
</html>
% END_INDENT

View File

@ -2,6 +2,16 @@
" START_INDENT " START_INDENT
<html>
<body>
<style>
div#d1 { color: red; }
div#d2 { color: green; }
</style>
<script>
var v1 = "v1";
var v2 = "v2";
</script>
<div> <div>
<div> <div>
text text
@ -32,5 +42,25 @@
</dt> </dt>
</dl> </dl>
</body>
</html>
" END_INDENT " END_INDENT
% START_INDENT
% INDENT_EXE let g:html_indent_style1 = "inc"
% INDENT_EXE let g:html_indent_script1 = "zero"
% INDENT_EXE call HtmlIndent_CheckUserSettings()
<html>
<body>
<style>
div#d1 { color: red; }
div#d2 { color: green; }
</style>
<script>
var v1 = "v1";
var v2 = "v2";
</script>
</body>
</html>
% END_INDENT

File diff suppressed because it is too large Load Diff