summaryrefslogtreecommitdiffstats
path: root/runtime/doc
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-01-29 22:20:48 +0000
committerBram Moolenaar <Bram@vim.org>2022-01-29 22:20:48 +0000
commitf10911e5db16f1fe6ab519c5d091ad0c1df0d063 (patch)
treee8718e5e667d36b3c206e1778fc630e42bcf757d /runtime/doc
parent62aec93bfdb9e1b40d03a6d2e8e9511f8b1bdb2d (diff)
Update runtime files
Diffstat (limited to 'runtime/doc')
-rw-r--r--runtime/doc/builtin.txt39
-rw-r--r--runtime/doc/change.txt11
-rw-r--r--runtime/doc/eval.txt39
-rw-r--r--runtime/doc/if_perl.txt4
-rw-r--r--runtime/doc/index.txt8
-rw-r--r--runtime/doc/message.txt12
-rw-r--r--runtime/doc/options.txt20
-rw-r--r--runtime/doc/print.txt6
-rw-r--r--runtime/doc/tags56
-rw-r--r--runtime/doc/testing.txt6
-rw-r--r--runtime/doc/todo.txt24
-rw-r--r--runtime/doc/usr_41.txt4
-rw-r--r--runtime/doc/vim9.txt65
13 files changed, 200 insertions, 94 deletions
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index f858440a9e..aaf4e3b5e4 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -1,4 +1,4 @@
-*builtin.txt* For Vim version 8.2. Last change: 2022 Jan 22
+*builtin.txt* For Vim version 8.2. Last change: 2022 Jan 28
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -2086,6 +2086,22 @@ exists({expr}) The result is a Number, which is |TRUE| if {expr} is defined,
For checking if a file exists use |filereadable()|.
The {expr} argument is a string, which contains one of these:
+ varname internal variable (see
+ dict.key |internal-variables|). Also works
+ list[i] for |curly-braces-names|, |Dictionary|
+ import.Func entries, |List| items, imported
+ items,etc.
+ Does not work for local variables in a
+ compiled `:def` function.
+ Beware that evaluating an index may
+ cause an error message for an invalid
+ expression. E.g.: >
+ :let l = [1, 2, 3]
+ :echo exists("l[5]")
+< 0 >
+ :echo exists("l[xx]")
+< E121: Undefined variable: xx
+ 0
&option-name Vim option (only checks if it exists,
not if it really works)
+option-name Vim option that works.
@@ -2100,21 +2116,6 @@ exists({expr}) The result is a Number, which is |TRUE| if {expr} is defined,
?funcname built-in function that could be
implemented; to be used to check if
"funcname" is valid
- varname internal variable (see
- |internal-variables|). Also works
- for |curly-braces-names|, |Dictionary|
- entries, |List| items, etc.
- Does not work for local variables in a
- compiled `:def` function.
- Beware that evaluating an index may
- cause an error message for an invalid
- expression. E.g.: >
- :let l = [1, 2, 3]
- :echo exists("l[5]")
-< 0 >
- :echo exists("l[xx]")
-< E121: Undefined variable: xx
- 0
:cmdname Ex command: built-in command, user
command or command modifier |:command|.
Returns:
@@ -2539,7 +2540,7 @@ flatten({list} [, {maxdepth}]) *flatten()*
The {list} is changed in place, use |flattennew()| if you do
not want that.
In Vim9 script flatten() cannot be used, you must always use
- |flattennew()|.
+ |flattennew()|. *E1158*
*E900*
{maxdepth} means how deep in nested lists changes are made.
{list} is not modified when {maxdepth} is 0.
@@ -6540,7 +6541,7 @@ reduce({object}, {func} [, {initial}]) *reduce()* *E998*
{func} is called for every item in {object}, which can be a
|String|, |List| or a |Blob|. {func} is called with two
arguments: the result so far and current item. After
- processing all items the result is returned.
+ processing all items the result is returned. *E1132*
{initial} is the initial result. When omitted, the first item
in {object} is used and {func} is first called for the second
@@ -7399,7 +7400,7 @@ setcellwidths({list}) *setcellwidths()*
setcellwidths([[0xad, 0xad, 1],
\ [0x2194, 0x2199, 2]])
-< *E1109* *E1110* *E1111* *E1112* *E1113*
+< *E1109* *E1110* *E1111* *E1112* *E1113* *E1114*
The {list} argument is a list of lists with each three
numbers. These three numbers are [low, high, width]. "low"
and "high" can be the same, in which case this refers to one
diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt
index 2799dc9e6d..7e1030bb91 100644
--- a/runtime/doc/change.txt
+++ b/runtime/doc/change.txt
@@ -1,4 +1,4 @@
-*change.txt* For Vim version 8.2. Last change: 2021 Dec 29
+*change.txt* For Vim version 8.2. Last change: 2022 Jan 28
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1176,10 +1176,13 @@ register. With blockwise selection it also depends on the size of the block
and whether the corners are on an existing character. (Implementation detail:
it actually works by first putting the register after the selection and then
deleting the selection.)
-The previously selected text is put in the unnamed register. If you want to
-put the same text into a Visual selection several times you need to use
+With 'p' the previously selected text is put in the unnamed register. This is
+useful if you want to put that text somewhere else. But you cannot repeat the
+same change.
+With 'P' the unnamed register is not changed, you can repeat the same change.
+But the deleted text cannot be used. If you do need it you can use 'p' with
another register. E.g., yank the text to copy, Visually select the text to
-replace and use "0p . You can repeat this as many times as you like, the
+replace and use "0p . You can repeat this as many times as you like, and the
unnamed register will be changed each time.
When you use a blockwise Visual mode command and yank only a single line into
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index a204735ec0..258d0a11e5 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1,4 +1,4 @@
-*eval.txt* For Vim version 8.2. Last change: 2022 Jan 21
+*eval.txt* For Vim version 8.2. Last change: 2022 Jan 24
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -44,7 +44,8 @@ Profiling is documented at |profiling|.
1. Variables *variables*
1.1 Variable types ~
- *E712* *E896* *E897* *E899*
+ *E712* *E896* *E897* *E899* *E1098*
+ *E1107* *E1135* *E1138*
There are ten types of variables:
*Number* *Integer*
@@ -180,7 +181,7 @@ You will not get an error if you try to change the type of a variable.
1.2 Function references ~
- *Funcref* *E695* *E718*
+ *Funcref* *E695* *E718* *E1086*
A Funcref variable is obtained with the |function()| function, the |funcref()|
function or created with the lambda expression |expr-lambda|. It can be used
in an expression in the place of a function name, before the parenthesis
@@ -835,7 +836,7 @@ In legacy script it is possible to form a variable name with curly braces, see
==============================================================================
2. Expression syntax *expression-syntax*
-
+ *E1143*
Expression syntax summary, from least to most significant:
|expr1| expr2
@@ -916,6 +917,9 @@ Example: >
All expressions within one level are parsed from left to right.
+Expression nesting is limited to 1000 levels deep (300 when build with MSVC)
+to avoid running out of stack and crashing. *E1169*
+
expr1 *expr1* *trinary* *falsy-operator* *??* *E109*
-----
@@ -1339,7 +1343,7 @@ Note that the dot is also used for String concatenation. To avoid confusion
always put spaces around the dot for String concatenation.
-expr9(expr1, ...) |Funcref| function call
+expr9(expr1, ...) |Funcref| function call *E1085*
When expr9 is a |Funcref| type variable, invoke the function it refers to.
@@ -1577,7 +1581,7 @@ The first one probably doesn't echo anything, the second echoes the $shell
variable (if your shell supports it).
-internal variable *expr-variable* *E1015*
+internal variable *expr-variable* *E1015* *E1089*
-----------------
variable internal variable
See below |internal-variables|.
@@ -2709,7 +2713,7 @@ See |:verbose-cmd| for more information.
command, use line breaks instead of |:bar|: >
:exe "func Foo()\necho 'foo'\nendfunc"
<
- *:delf* *:delfunction* *E131* *E933*
+ *:delf* *:delfunction* *E131* *E933* *E1084*
:delf[unction][!] {name}
Delete function {name}.
{name} can also be a |Dictionary| entry that is a
@@ -2726,8 +2730,11 @@ See |:verbose-cmd| for more information.
If "[expr]" is not given, the number 0 is returned.
When a function ends without an explicit ":return",
the number 0 is returned.
- Note that there is no check for unreachable lines,
- thus there is no warning if commands follow ":return".
+ In a :def function *E1095* is given if unreachable
+ code follows after the `:return`.
+ In legacy script there is no check for unreachable
+ lines, thus there is no warning if commands follow
+ `:return`.
If the ":return" is used after a |:try| but before the
matching |:finally| (if present), the commands
@@ -2746,7 +2753,7 @@ may optionally be following. In the function the extra arguments can be used
as "a:1", "a:2", etc. "a:0" is set to the number of extra arguments (which
can be 0). "a:000" is set to a |List| that contains these arguments. Note
that "a:1" is the same as "a:000[0]".
- *E742*
+ *E742* *E1090*
The a: scope and the variables in it cannot be changed, they are fixed.
However, if a composite type is used, such as |List| or |Dictionary| , you can
change their contents. Thus you can pass a |List| to a function and have the
@@ -3054,7 +3061,7 @@ declarations and assignments do not use a command. |vim9-declaration|
from the {expr}. If {var-name} didn't exist yet, it
is created.
-:let {var-name}[{idx}] = {expr1} *E689*
+:let {var-name}[{idx}] = {expr1} *E689* *E1141*
Set a list item to the result of the expression
{expr1}. {var-name} must refer to a list and {idx}
must be a valid index in that list. For nested list
@@ -3161,7 +3168,7 @@ declarations and assignments do not use a command. |vim9-declaration|
:let &g:{option-name} -= {expr1}
Like above, but only set the global value of an option
(if there is one). Works like |:setglobal|.
-
+ *E1093*
:let [{name1}, {name2}, ...] = {expr1} *:let-unpack* *E687* *E688*
{expr1} must evaluate to a |List|. The first item in
the list is assigned to {name1}, the second item to
@@ -3202,7 +3209,7 @@ declarations and assignments do not use a command. |vim9-declaration|
|List| item.
*:let=<<* *:let-heredoc*
- *E990* *E991* *E172* *E221*
+ *E990* *E991* *E172* *E221* *E1145*
:let {var-name} =<< [trim] {endmarker}
text...
text...
@@ -3355,7 +3362,7 @@ text...
:lockvar v
:let v = 'asdf' " fails!
:unlet v " works
-< *E741* *E940*
+< *E741* *E940* *E1118* *E1119* *E1120* *E1121* *E1122*
If you try to change a locked variable you get an
error message: "E741: Value is locked: {name}".
If you try to lock or unlock a built-in variable you
@@ -3498,7 +3505,7 @@ text...
|Blob| does not affect the iteration.
:for [{var1}, {var2}, ...] in {listlist}
-:endfo[r]
+:endfo[r] *E1140*
Like ":for" above, but each item in {listlist} must be
a list, of which each item is assigned to {var1},
{var2}, etc. Example: >
@@ -3601,7 +3608,7 @@ text...
|:break|, |:finish|, or |:return|, or by an error or
interrupt or exception (see |:throw|).
- *:th* *:throw* *E608*
+ *:th* *:throw* *E608* *E1129*
:th[row] {expr1} The {expr1} is evaluated and thrown as an exception.
If the ":throw" is used after a |:try| but before the
first corresponding |:catch|, commands are skipped
diff --git a/runtime/doc/if_perl.txt b/runtime/doc/if_perl.txt
index a85b680053..f1060e88dd 100644
--- a/runtime/doc/if_perl.txt
+++ b/runtime/doc/if_perl.txt
@@ -1,4 +1,4 @@
-*if_perl.txt* For Vim version 8.2. Last change: 2022 Jan 08
+*if_perl.txt* For Vim version 8.2. Last change: 2022 Jan 28
VIM REFERENCE MANUAL by Sven Verdoolaege
@@ -103,7 +103,7 @@ Here are some things you can try: >
:perldo $_ = reverse($_);1
:perl VIM::Msg("hello")
:perl $line = $curbuf->Get(42)
-<
+< *E299*
Executing Perl commands in the |sandbox| is limited. ":perldo" will not be
possible at all. ":perl" will be evaluated in the Safe environment, if
possible.
diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt
index cbf363a77c..c4129ea22e 100644
--- a/runtime/doc/index.txt
+++ b/runtime/doc/index.txt
@@ -1,4 +1,4 @@
-*index.txt* For Vim version 8.2. Last change: 2021 Aug 31
+*index.txt* For Vim version 8.2. Last change: 2022 Jan 28
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -937,7 +937,9 @@ tag command note action in Visual mode ~
before the highlighted area
|v_J| J 2 join the highlighted lines
|v_K| K run 'keywordprg' on the highlighted area
-|v_O| O Move horizontally to other corner of area.
+|v_O| O move horizontally to other corner of area
+|v_P| P replace highlighted area with register
+ contents; unnamed register is unchanged
Q does not start Ex mode
|v_R| R 2 delete the highlighted lines and start
insert
@@ -1000,6 +1002,8 @@ tag command note action in Visual mode ~
|v_i{| i{ same as iB
|v_i}| i} same as iB
|v_o| o move cursor to other corner of area
+|v_p| p replace highlighted area with register
+ contents; deleted text in unnamed register
|v_r| r 2 replace highlighted area with a character
|v_s| s 2 delete highlighted area and start insert
|v_u| u 2 make highlighted area lowercase
diff --git a/runtime/doc/message.txt b/runtime/doc/message.txt
index 44ad8bc2f2..760e9ca107 100644
--- a/runtime/doc/message.txt
+++ b/runtime/doc/message.txt
@@ -1,4 +1,4 @@
-*message.txt* For Vim version 8.2. Last change: 2022 Jan 19
+*message.txt* For Vim version 8.2. Last change: 2022 Jan 26
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -82,7 +82,6 @@ LIST OF MESSAGES
Add to read buffer ~
makemap: Illegal mode ~
Cannot create BalloonEval with both message and callback ~
- Hangul automata ERROR ~
block was not locked ~
Didn't get block nr {N}? ~
ml_upd_block0(): Didn't get block 0?? ~
@@ -92,12 +91,12 @@ LIST OF MESSAGES
u_undo: line numbers wrong ~
undo list corrupt ~
undo line missing ~
- ml_get: cannot find line {N} ~
- cannot find line {N} ~
+ ml_get: cannot find line {N} in buffer {nr} {name} ~
line number out of range: {N} past the end ~
line count wrong in block {N} ~
- Internal error ~
+ Internal error: lalloc(0, ) ~
Internal error: {function} ~
+ Internal error in regexp ~
fatal error in cs_manage_matches ~
Invalid count for del_bytes(): {N} ~
@@ -728,6 +727,7 @@ specified.
*E488*
Trailing characters ~
+ Trailing characters: {text} ~
An argument has been added to an Ex command that does not permit one.
Or the argument has invalid characters and has not been recognized.
@@ -798,7 +798,7 @@ This is an (incomplete) overview of various messages that Vim gives:
*hit-enter* *press-enter* *hit-return*
*press-return* *hit-enter-prompt*
- Press ENTER or type command to continue
+ Press ENTER or type command to continue ~
This message is given when there is something on the screen for you to read,
and the screen is about to be redrawn:
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 199c261761..8c9ff3d43f 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1,4 +1,4 @@
-*options.txt* For Vim version 8.2. Last change: 2022 Jan 22
+*options.txt* For Vim version 8.2. Last change: 2022 Jan 29
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1558,8 +1558,8 @@ A jump table for the options with a short description can be found at |Q_op|.
preferred, because it is much faster.
'charconvert' is not used when reading stdin |--|, because there is no
file to convert from. You will have to save the text in a file first.
- The expression must return zero or an empty string for success,
- non-zero for failure.
+ The expression must return zero, false or an empty string for success,
+ non-zero or true for failure.
The possible encoding names encountered are in 'encoding'.
Additionally, names given in 'fileencodings' and 'fileencoding' are
used.
@@ -1583,9 +1583,18 @@ A jump table for the options with a short description can be found at |Q_op|.
Note that v:fname_in and v:fname_out will never be the same.
Note that v:charconvert_from and v:charconvert_to may be different
from 'encoding'. Vim internally uses UTF-8 instead of UCS-2 or UCS-4.
+
Encryption is not done by Vim when using 'charconvert'. If you want
to encrypt the file after conversion, 'charconvert' should take care
of this.
+
+ If the 'charconvert' expression starts with s: or |<SID>|, then it is
+ replaced with the script ID (|local-function|). Example: >
+ set charconvert=s:MyConvert()
+ set charconvert=<SID>SomeConvert()
+< Otherwise the expression is evaluated in the context of the script
+ where the option was set, thus script-local items are available.
+
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
@@ -7777,10 +7786,11 @@ A jump table for the options with a short description can be found at |Q_op|.
'tabstop' 'ts' number (default 8)
local to buffer
Number of spaces that a <Tab> in the file counts for. Also see
- |:retab| command, and 'softtabstop' option.
+ the |:retab| command, and the 'softtabstop' option.
Note: Setting 'tabstop' to any other value than 8 can make your file
- appear wrong in many places (e.g., when printing it).
+ appear wrong in many places, e.g., when printing it.
+ The value must be more than 0 and less than 10000.
There are four main ways to use tabs in Vim:
1. Always keep 'tabstop' at 8, set 'softtabstop' and 'shiftwidth' to 4
diff --git a/runtime/doc/print.txt b/runtime/doc/print.txt
index eebdf7ea02..771a58cec0 100644
--- a/runtime/doc/print.txt
+++ b/runtime/doc/print.txt
@@ -1,4 +1,4 @@
-*print.txt* For Vim version 8.2. Last change: 2021 Oct 04
+*print.txt* For Vim version 8.2. Last change: 2022 Jan 23
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -178,7 +178,9 @@ If the expression starts with s: or |<SID>|, then it is replaced with the
script ID (|local-function|). Example: >
set printexpr=s:MyPrintFile()
set printexpr=<SID>SomePrintFile()
-<
+Otherwise, the expression is evaluated in the context of the script where the
+option was set, thus script-local items are available.
+
This option cannot be set from a |modeline| or in the |sandbox|, for security
reasons.
diff --git a/runtime/doc/tags b/runtime/doc/tags
index 835f7a7fb2..15f017dd5b 100644
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -4033,25 +4033,77 @@ E1077 vim9.txt /*E1077*
E108 eval.txt /*E108*
E1081 eval.txt /*E1081*
E1083 editing.txt /*E1083*
+E1084 eval.txt /*E1084*
+E1085 eval.txt /*E1085*
+E1086 eval.txt /*E1086*
+E1087 vim9.txt /*E1087*
+E1089 eval.txt /*E1089*
E109 eval.txt /*E109*
+E1090 eval.txt /*E1090*
E1091 vim9.txt /*E1091*
+E1093 eval.txt /*E1093*
E1094 vim9.txt /*E1094*
+E1095 eval.txt /*E1095*
+E1096 vim9.txt /*E1096*
+E1097 vim9.txt /*E1097*
+E1098 eval.txt /*E1098*
+E1099 vim9.txt /*E1099*
E11 cmdline.txt /*E11*
E110 eval.txt /*E110*
+E1100 vim9.txt /*E1100*
+E1101 vim9.txt /*E1101*
+E1102 vim9.txt /*E1102*
+E1103 vim9.txt /*E1103*
+E1104 vim9.txt /*E1104*
+E1105 vim9.txt /*E1105*
+E1106 vim9.txt /*E1106*
+E1107 eval.txt /*E1107*
+E1108 vim9.txt /*E1108*
E1109 builtin.txt /*E1109*
E111 eval.txt /*E111*
E1110 builtin.txt /*E1110*
E1111 builtin.txt /*E1111*
E1112 builtin.txt /*E1112*
E1113 builtin.txt /*E1113*
+E1114 builtin.txt /*E1114*
+E1115 testing.txt /*E1115*
+E1116 testing.txt /*E1116*
+E1117 vim9.txt /*E1117*
+E1118 eval.txt /*E1118*
+E1119 eval.txt /*E1119*
E112 eval.txt /*E112*
+E1120 eval.txt /*E1120*
+E1121 eval.txt /*E1121*
+E1122 eval.txt /*E1122*
+E1123 vim9.txt /*E1123*
+E1124 vim9.txt /*E1124*
+E1125 vim9.txt /*E1125*
+E1126 vim9.txt /*E1126*
+E1127 vim9.txt /*E1127*
+E1128 vim9.txt /*E1128*
+E1129 eval.txt /*E1129*
E113 eval.txt /*E113*
+E1130 vim9.txt /*E1130*
+E1131 vim9.txt /*E1131*
+E1132 builtin.txt /*E1132*
+E1133 vim9.txt /*E1133*
+E1134 vim9.txt /*E1134*
+E1135 eval.txt /*E1135*
E1136 map.txt /*E1136*
E1137 map.txt /*E1137*
+E1138 eval.txt /*E1138*
+E1139 vim9.txt /*E1139*
E114 eval.txt /*E114*
+E1140 eval.txt /*E1140*
+E1141 eval.txt /*E1141*
+E1143 eval.txt /*E1143*
+E1144 vim9.txt /*E1144*
+E1145 eval.txt /*E1145*
E115 eval.txt /*E115*
E1155 autocmd.txt /*E1155*
+E1158 builtin.txt /*E1158*
E116 eval.txt /*E116*
+E1169 eval.txt /*E1169*
E117 eval.txt /*E117*
E118 eval.txt /*E118*
E1187 starting.txt /*E1187*
@@ -4269,6 +4321,7 @@ E295 message.txt /*E295*
E296 message.txt /*E296*
E297 message.txt /*E297*
E298 message.txt /*E298*
+E299 if_perl.txt /*E299*
E30 change.txt /*E30*
E300 message.txt /*E300*
E301 message.txt /*E301*
@@ -7726,6 +7779,7 @@ interactive-functions usr_41.txt /*interactive-functions*
interfaces-5.2 version5.txt /*interfaces-5.2*
internal-variables eval.txt /*internal-variables*
internal-wordlist spell.txt /*internal-wordlist*
+internal_get_nv_cmdchar() builtin.txt /*internal_get_nv_cmdchar()*
internet intro.txt /*internet*
interrupt() builtin.txt /*interrupt()*
intro intro.txt /*intro*
@@ -9867,6 +9921,8 @@ test_garbagecollect_soon() testing.txt /*test_garbagecollect_soon()*
test_getvalue() testing.txt /*test_getvalue()*
test_gui_drop_files() testing.txt /*test_gui_drop_files()*
test_gui_mouse_event() testing.txt /*test_gui_mouse_event()*
+test_gui_tabline_event() testing.txt /*test_gui_tabline_event()*
+test_gui_tabmenu_event() testing.txt /*test_gui_tabmenu_event()*
test_ignore_error() testing.txt /*test_ignore_error()*
test_null_blob() testing.txt /*test_null_blob()*
test_null_channel() testing.txt /*test_null_channel()*
diff --git a/runtime/doc/testing.txt b/runtime/doc/testing.txt
index e5b9134736..ed5f98a565 100644
--- a/runtime/doc/testing.txt
+++ b/runtime/doc/testing.txt
@@ -1,4 +1,4 @@
-*testing.txt* For Vim version 8.2. Last change: 2022 Jan 20
+*testing.txt* For Vim version 8.2. Last change: 2022 Jan 23
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -390,12 +390,12 @@ assert_fails({cmd} [, {error} [, {msg} [, {lnum} [, {context}]]]])
<
If {msg} is empty then it is not used. Do this to get the
default message when passing the {lnum} argument.
-
+ *E1115*
When {lnum} is present and not negative, and the {error}
argument is present and matches, then this is compared with
the line number at which the error was reported. That can be
the line number in a function or in a script.
-
+ *E1116*
When {context} is present it is used as a pattern and matched
against the context (script name or function name) where
{lnum} is located in.
diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index a0f17aa7a6..6743b64da9 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -1,4 +1,4 @@
-*todo.txt* For Vim version 8.2. Last change: 2022 Jan 22
+*todo.txt* For Vim version 8.2. Last change: 2022 Jan 29
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -38,13 +38,22 @@ browser use: https://github.com/vim/vim/issues/1234
*known-bugs*
-------------------- Known bugs and current work -----------------------
-Also set the script context for other "expr" options, like for 'foldexpr'?
- 'printexpr' eval_printexpr()
- "expr:" part of 'spellsuggest eval_spell_expr()
+Only find a global function from Vim9 script when using "g:" ? #9637
+
+Disallow defining a script#Func() in Vim9 script.
+
+Cannot use command modifier for "import 'name.vim' as vim9"
+
+When making a copy of a list or dict, do not keep the type? #9644
+ With deepcopy() all, with copy() this still fails:
+ var l: list<list<number>> = [[1], [2]]
+ l->copy()[0][0] = 'x'
+
+Remove EBCDIC support?
Once Vim9 is stable:
- Add all the error numbers in a good place in documentation.
- done until E1083
+ done until E1145
- Check code coverage, add more tests if needed.
- Use Vim9 for runtime files.
@@ -62,6 +71,8 @@ Further Vim9 improvements, possibly after launch:
evaluation.
Use the location where the option was set for deciding whether it's to be
evaluated in Vim9 script context.
+- Implement "import lazy" - like autoload but with a relative or absolute
+ path. #9595
- implement :type
- implement :enum
- implement :class and :interface: See |vim9-classes|
@@ -78,6 +89,7 @@ Further Vim9 improvements, possibly after launch:
Update list of features to vote on:
- multiple cursors
- built-in LSP support
+- start first line halfway
Popup windows:
- Preview popup not properly updated when it overlaps with completion menu.
@@ -235,6 +247,8 @@ Memory leak in test_alot with pyeval() (allocating partial)
Memory leak in test_alot with expand()
Memory leaks in test_channel? (or is it because of fork())
+PR to support %e and %k in 'errorformat'. #9624
+
Idea: when typing ":e /some/dir/" and "dir" does not exist, highlight in red.
":set &shellpipe" and ":set &shellredir" should use the logic from
diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt
index ec6db500a6..623fd3b598 100644
--- a/runtime/doc/usr_41.txt
+++ b/runtime/doc/usr_41.txt
@@ -1,4 +1,4 @@
-*usr_41.txt* For Vim version 8.2. Last change: 2022 Jan 01
+*usr_41.txt* For Vim version 8.2. Last change: 2022 Jan 28
VIM USER MANUAL - by Bram Moolenaar
@@ -2505,7 +2505,7 @@ When the user does ":setfiletype xyz" the effect of the previous filetype
should be undone. Set the b:undo_ftplugin variable to the commands that will
undo the settings in your filetype plugin. Example: >
- b:undo_ftplugin = "setlocal fo< com< tw< commentstring<"
+ let b:undo_ftplugin = "setlocal fo< com< tw< commentstring<"
\ .. "| unlet b:match_ignorecase b:match_words b:match_skip"
Using ":setlocal" with "<" after the option name resets the option to its
diff --git a/runtime/doc/vim9.txt b/runtime/doc/vim9.txt
index 0172dffe84..2baf46c599 100644
--- a/runtime/doc/vim9.txt
+++ b/runtime/doc/vim9.txt
@@ -1,4 +1,4 @@
-*vim9.txt* For Vim version 8.2. Last change: 2022 Jan 23
+*vim9.txt* For Vim version 8.2. Last change: 2022 Jan 29
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -82,7 +82,7 @@ script and `:def` functions; details are below:
.. yourName
.. ", how are you?"
- White space is required in many places to improve readability.
-- Assign values without `:let`, declare variables with `:var`: >
+- Assign values without `:let` *E1126* , declare variables with `:var`: >
var count = 0
count += 3
- Constants can be declared with `:final` and `:const`: >
@@ -139,7 +139,7 @@ arguments).
Vim9 functions ~
-
+ *E1099*
A function defined with `:def` is compiled. Execution is many times faster,
often 10 to 100 times.
@@ -183,11 +183,11 @@ You can call a legacy dict function though: >
var d = {func: Legacy, value: 'text'}
d.func()
enddef
-
+< *E1096*
The argument types and return type need to be specified. The "any" type can
be used, type checking will then be done at runtime, like with legacy
functions.
-
+ *E1106*
Arguments are accessed by name, without "a:", just like any other language.
There is no "a:" dictionary or "a:000" list.
*vim9-variable-arguments* *E1055*
@@ -238,9 +238,6 @@ When referring to a function and no "s:" or "g:" prefix is used, Vim will
search for the function:
- in the function scope, in block scopes
- in the script scope, possibly imported
-- in the list of global functions
-However, it is recommended to always use "g:" to refer to a global function
-for clarity.
Since a script-local function reference can be used without "s:" the name must
start with an upper case letter even when using the "s:" prefix. In legacy
@@ -255,7 +252,7 @@ it is being compiled (to figure out the return type).
The result is that functions and variables without a namespace can usually be
found in the script, either defined there or imported. Global functions and
variables could be defined anywhere (good luck finding out where!).
-
+ *E1102*
Global functions can still be defined and deleted at nearly any time. In
Vim9 script script-local functions are defined once when the script is sourced
and cannot be deleted or replaced.
@@ -289,8 +286,8 @@ some point when loaded again. E.g. when a buffer local option is set: >
Variable declarations with :var, :final and :const ~
- *vim9-declaration* *:var*
- *E1017* *E1020* *E1054*
+ *vim9-declaration* *:var*
+ *E1017* *E1020* *E1054* *E1087* *E1108* *E1124*
Local variables need to be declared with `:var`. Local constants need to be
declared with `:final` or `:const`. We refer to both as "variables" in this
section.
@@ -321,7 +318,7 @@ The declaration must be done earlier: >
inner = 0
endif
echo inner
-< *E1025*
+< *E1025* *E1128*
To intentionally hide a variable from code that follows, a block can be
used: >
{
@@ -348,7 +345,7 @@ And with autocommands: >
}
Although using a :def function probably works better.
- *E1022*
+ *E1022* *E1103* *E1130* *E1131* *E1133* *E1134*
Declaring a variable with a type but without an initializer will initialize to
false (for bool), empty (for string, list, dict, etc.) or zero (for number,
any, etc.). This matters especially when using the "any" type, the value will
@@ -440,7 +437,7 @@ Example: >
myList = [3, 4] # Error!
myList[0] = 9 # Error!
myList->add(3) # Error!
-< *:final*
+< *:final* *E1125*
`:final` is used for making only the variable a constant, the value can be
changed. This is well known from Java. Example: >
final myList = [1, 2]
@@ -600,7 +597,7 @@ Also when confused with the start of a command block: >
Automatic line continuation ~
- *vim9-line-continuation*
+ *vim9-line-continuation* *E1097*
In many cases it is obvious that an expression continues on the next line. In
those cases there is no need to prefix the line with a backslash (see
|line-continuation|). For example, when a list spans multiple lines: >
@@ -708,6 +705,7 @@ second line is seen as a separate command: >
Now "exit_cb: Func})" is actually a valid command: save any changes to the
file "_cb: Func})" and exit. To avoid this kind of mistake in Vim9 script
there must be white space between most command names and the argument.
+*E1144*
However, the argument of a command that is a command won't be recognized. For
example, after "windo echo expr" a line break inside "expr" will not be seen.
@@ -738,7 +736,7 @@ Notes:
White space ~
- *E1004* *E1068* *E1069* *E1074*
+ *E1004* *E1068* *E1069* *E1074* *E1127*
Vim9 script enforces proper use of white space. This is no longer allowed: >
var name=234 # Error!
var name= 234 # Error!
@@ -803,7 +801,7 @@ 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
-
+< *E1139*
In case the key needs to be an expression, square brackets can be used, just
like in JavaScript: >
var dict = {["key" .. nr]: value}
@@ -816,7 +814,7 @@ error. A number can be given with and without the []: >
No :xit, :t, :k, :append, :change or :insert ~
-
+ *E1100*
These commands are too easily confused with local variable names.
Instead of `:x` or `:xit` you can use `:exit`.
Instead of `:t` you can use `:copy`.
@@ -1082,7 +1080,7 @@ Using ++var or --var in an expression is not supported yet.
{return-type}. When {return-type} is omitted or is
"void" the function is not expected to return
anything.
- *E1077*
+ *E1077* *E1123*
{arguments} is a sequence of zero or more argument
declarations. There are three forms:
{name}: {type}
@@ -1100,7 +1098,7 @@ Using ++var or --var in an expression is not supported yet.
It is possible to nest `:def` inside another `:def` or
`:function` up to about 50 levels deep.
-
+ *E1117*
[!] is used as with `:function`. Note that
script-local functions cannot be deleted or redefined
later in Vim9 script. They can only be removed by
@@ -1288,7 +1286,7 @@ expected to always be the same. For example, when declaring a list: >
At compile time Vim doesn't know the type of "g:two" and the expression type
becomes list<any>. An instruction is generated to check the list type before
doing the assignment, which is a bit inefficient.
- *type-casting*
+ *type-casting* *E1104*
To avoid this, use a type cast: >
var l: list<number> = [1, <number>g:two]
The compiled code will then only check that "g:two" is a number and give an
@@ -1333,6 +1331,14 @@ Results in:
For script-local variables in Vim9 script the type is checked, also when the
variable was declared in a legacy function.
+When a type has been declared this is attached to a list or string. When
+later some expression attempts to change the type an error will be given: >
+ var ll: list<number> = [1, 2, 3]
+ ll->extend('x') # Error, 'x' is not a number
+
+If the type is inferred then the type is allowed to change: >
+ [1, 2, 3]->extend('x') # result: [1, 2, 3, 'x']
+
Stricter type checking ~
*type-checking*
@@ -1347,7 +1353,7 @@ before, if the value used matches the expected type. There will sometimes be
an error, thus breaking backwards compatibility. For example:
- Using a number other than 0 or 1 where a boolean is expected. *E1023*
- Using a string value when setting a number option.
-- Using a number where a string is