Update runtime files
diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt
index 9e482c8..9c52e8d 100644
--- a/runtime/doc/change.txt
+++ b/runtime/doc/change.txt
@@ -1458,7 +1458,7 @@
func! format#Format()
" only reformat on explicit gq command
if mode() != 'n'
- " fall back to Vims internal reformatting
+ " fall back to Vim's internal reformatting
return 1
endif
let lines = getline(v:lnum, v:lnum + v:count - 1)
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 981a358..7dbd992 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1,4 +1,4 @@
-*eval.txt* For Vim version 8.2. Last change: 2020 Mar 26
+*eval.txt* For Vim version 8.2. Last change: 2020 Apr 08
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -5137,10 +5137,11 @@
<
*getcurpos()*
getcurpos() Get the position of the cursor. This is like getpos('.'), but
- includes an extra item in the list:
- [bufnum, lnum, col, off, curswant] ~
+ includes an extra "curswant" item in the list:
+ [0, lnum, col, off, curswant] ~
The "curswant" number is the preferred column when moving the
cursor vertically. Also see |getpos()|.
+ The first "bufnum" item is always zero.
This can be used to save and restore the cursor position: >
let save_cursor = getcurpos()
@@ -8917,18 +8918,10 @@
Returns zero for success, -1 for failure.
- Examples:
- Set current index of the tag stack to 4: >
- call settagstack(1005, {'curidx' : 4})
-
-< Empty the tag stack of window 3: >
+ Examples (for more examples see |tagstack-examples||):
+ Empty the tag stack of window 3: >
call settagstack(3, {'items' : []})
-< Push a new item onto the tag stack: >
- let pos = [bufnr('myfile.txt'), 10, 1, 0]
- let newtag = [{'tagname' : 'mytag', 'from' : pos}]
- call settagstack(2, {'items' : newtag}, 'a')
-
< Save and restore the tag stack: >
let stack = gettagstack(1003)
" do something else
@@ -10876,6 +10869,7 @@
iconv Can use iconv() for conversion.
insert_expand Compiled with support for CTRL-X expansion commands in
Insert mode. (always true)
+job Compiled with support for |channel| and |job|
jumplist Compiled with |jumplist| support.
keymap Compiled with 'keymap' support.
lambda Compiled with |lambda| support.
@@ -11240,8 +11234,8 @@
You can provide default values for positional named arguments. This makes
them optional for function calls. When a positional argument is not
specified at a call, the default expression is used to initialize it.
-This only works for functions declared with `:function`, not for lambda
-expressions |expr-lambda|.
+This only works for functions declared with `:function` or `:def`, not for
+lambda expressions |expr-lambda|.
Example: >
function Something(key, value = 10)
@@ -11279,9 +11273,10 @@
:function NoGood(first = a:second, second = 10)
:endfunction
<
-When not using "...", the number of arguments in a function call must be equal
-to the number of mandatory named arguments. When using "...", the number of
-arguments may be larger.
+When not using "...", the number of arguments in a function call must be at
+least equal to the number of mandatory named arguments. When using "...", the
+number of arguments may be larger than the total of mandatory and optional
+arguments.
*local-variables*
Inside a function local variables can be used. These will disappear when the
@@ -11638,7 +11633,7 @@
Like above, but append/add/subtract the value for each
|List| item.
-:let [{name}, ..., ; {lastname}] = {expr1}
+:let [{name}, ..., ; {lastname}] = {expr1} *E452*
Like |:let-unpack| above, but the |List| may have more
items than there are names. A list of the remaining
items is assigned to {lastname}. If there are no
diff --git a/runtime/doc/gui_w32.txt b/runtime/doc/gui_w32.txt
index fda3618..30e2287 100644
--- a/runtime/doc/gui_w32.txt
+++ b/runtime/doc/gui_w32.txt
@@ -199,7 +199,7 @@
One reason to add this is to be able to edit HTML files directly from Internet
Explorer. To enable this use the "Tools" menu, "Internet Options..." entry.
In the dialog select the "Programs" tab and select Vim in the "HTML editor"
-choice. If it's not there than installing didn't work properly.
+choice. If it's not there then installing didn't work properly.
Doing this manually can be done with this script:
diff --git a/runtime/doc/help.txt b/runtime/doc/help.txt
index f2b7846..d858be1 100644
--- a/runtime/doc/help.txt
+++ b/runtime/doc/help.txt
@@ -1,4 +1,4 @@
-*help.txt* For Vim version 8.2. Last change: 2019 Jul 21
+*help.txt* For Vim version 8.2. Last change: 2020 Apr 05
VIM - main help file
k
@@ -31,7 +31,7 @@
help entries for "word".
Or use ":helpgrep word". |:helpgrep|
- Getting started: Do the Vim tutor, a 20 minute interactive training for the
+ Getting started: Do the Vim tutor, a 30-minute interactive course for the
basic commands, see |vimtutor|.
Read the user manual from start to end: |usr_01.txt|
@@ -41,7 +41,7 @@
*doc-file-list* *Q_ct*
BASIC:
|quickref| Overview of the most common commands you will use
-|tutor| 20 minutes training course for beginners
+|tutor| 30-minute interactive course for beginners
|copying| About copyrights
|iccf| Helping poor children in Uganda
|sponsor| Sponsor Vim development, become a registered Vim user
@@ -144,7 +144,7 @@
|remote.txt| using Vim as a server or client
|term.txt| using different terminals and mice
|terminal.txt| Terminal window support
-|popup.txt| popop window support
+|popup.txt| popup window support
Programming language support ~
|indent.txt| automatic indenting for C and other languages
diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt
index 934c1c5..99c2d40 100644
--- a/runtime/doc/insert.txt
+++ b/runtime/doc/insert.txt
@@ -154,6 +154,8 @@
you also want to avoid these, use CTRL-R CTRL-O, see below.
The '.' register (last inserted text) is still inserted as
typed.
+ After this command, the '.' register contains the text from
+ the register as if it was inserted by typing it.
CTRL-R CTRL-O {register} *i_CTRL-R_CTRL-O*
Insert the contents of a register literally and don't
@@ -163,6 +165,9 @@
Does not replace characters!
The '.' register (last inserted text) is still inserted as
typed.
+ After this command, the '.' register contains the command
+ typed and not the text. I.e., the literals "^R^O" and not the
+ text from the register.
CTRL-R CTRL-P {register} *i_CTRL-R_CTRL-P*
Insert the contents of a register literally and fix the
@@ -170,6 +175,9 @@
Does not replace characters!
The '.' register (last inserted text) is still inserted as
typed.
+ After this command, the '.' register contains the command
+ typed and not the text. I.e., the literals "^R^P" and not the
+ text from the register.
*i_CTRL-T*
CTRL-T Insert one shiftwidth of indent at the start of the current
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index b17be86..9410726 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1,4 +1,4 @@
-*options.txt* For Vim version 8.2. Last change: 2020 Mar 02
+*options.txt* For Vim version 8.2. Last change: 2020 Apr 10
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -7957,7 +7957,7 @@
- VIM the server name |v:servername| or "VIM"
Only works if the terminal supports setting window titles
(currently Amiga console, Win32 console, all GUI versions and
- terminals with a non- empty 't_ts' option - these are Unix xterm and
+ terminals with a non-empty 't_ts' option - these are Unix xterm and
iris-ansi by default, where 't_ts' is taken from the builtin termcap).
*X11*
When Vim was compiled with HAVE_X11 defined, the original title will
diff --git a/runtime/doc/os_beos.txt b/runtime/doc/os_beos.txt
index ba0e07f..916162f 100644
--- a/runtime/doc/os_beos.txt
+++ b/runtime/doc/os_beos.txt
@@ -138,7 +138,7 @@
6. The $VIM directory *beos-vimdir*
-$VIM is the symbolic name for the place where Vims support files are stored.
+$VIM is the symbolic name for the place where Vim's support files are stored.
The default value for $VIM is set at compile time and can be determined with >
:version
diff --git a/runtime/doc/os_haiku.txt b/runtime/doc/os_haiku.txt
index aabfe1c..2c02994 100644
--- a/runtime/doc/os_haiku.txt
+++ b/runtime/doc/os_haiku.txt
@@ -88,7 +88,7 @@
4. The $VIM directory *haiku-vimdir*
-$VIM is the symbolic name for the place where Vims support files are stored.
+$VIM is the symbolic name for the place where Vim's support files are stored.
The default value for $VIM is set at compile time and can be determined with >
:version
diff --git a/runtime/doc/tags b/runtime/doc/tags
index 379af50..68ac1a9 100644
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -4244,6 +4244,7 @@
E448 various.txt /*E448*
E449 eval.txt /*E449*
E45 message.txt /*E45*
+E452 eval.txt /*E452*
E455 print.txt /*E455*
E456 print.txt /*E456*
E457 print.txt /*E457*
@@ -9348,6 +9349,7 @@
tags-option tagsrch.txt /*tags-option*
tagsrch.txt tagsrch.txt /*tagsrch.txt*
tagstack tagsrch.txt /*tagstack*
+tagstack-examples tagsrch.txt /*tagstack-examples*
tan() eval.txt /*tan()*
tanh() eval.txt /*tanh()*
tar pi_tar.txt /*tar*
@@ -9503,6 +9505,7 @@
test_null_blob() testing.txt /*test_null_blob()*
test_null_channel() testing.txt /*test_null_channel()*
test_null_dict() testing.txt /*test_null_dict()*
+test_null_function() testing.txt /*test_null_function()*
test_null_job() testing.txt /*test_null_job()*
test_null_list() testing.txt /*test_null_list()*
test_null_partial() testing.txt /*test_null_partial()*
diff --git a/runtime/doc/tagsrch.txt b/runtime/doc/tagsrch.txt
index ed406e8..0b22deb 100644
--- a/runtime/doc/tagsrch.txt
+++ b/runtime/doc/tagsrch.txt
@@ -1,4 +1,4 @@
-*tagsrch.txt* For Vim version 8.2. Last change: 2020 Jan 30
+*tagsrch.txt* For Vim version 8.2. Last change: 2020 Apr 03
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -185,6 +185,29 @@
The |gettagstack()| function returns the tag stack of a specified window. The
|settagstack()| function modifies the tag stack of a window.
+ *tagstack-examples*
+Write to the tag stack just like `:tag` but with a user-defined
+jumper#jump_to_tag function: >
+ " Store where we're jumping from before we jump.
+ let tag = expand('<cword>')
+ let pos = [bufnr()] + getcurpos()[1:]
+ let item = {'bufnr': pos[0], 'from': pos, 'tagname': tag}
+ if jumper#jump_to_tag(tag)
+ " Jump was successful, write previous location to tag stack.
+ let winid = win_getid()
+ let stack = gettagstack(winid)
+ let stack['items'] = [item]
+ call settagstack(winid, stack, 't')
+ endif
+<
+Set current index of the tag stack to 4: >
+ call settagstack(1005, {'curidx' : 4})
+<
+Push a new item onto the tag stack: >
+ let pos = [bufnr('myfile.txt'), 10, 1, 0]
+ let newtag = [{'tagname' : 'mytag', 'from' : pos}]
+ call settagstack(2, {'items' : newtag}, 'a')
+<
*E73*
When you try to use the tag stack while it doesn't contain anything you will
get an error message.
diff --git a/runtime/doc/terminal.txt b/runtime/doc/terminal.txt
index ac9d658..8105b07 100644
--- a/runtime/doc/terminal.txt
+++ b/runtime/doc/terminal.txt
@@ -960,7 +960,7 @@
directory, thus it's best to use the full path.
[options] is only used when opening a new window. If present,
- it must be a Dict. Similarly to |++opt|, These entries are
+ it must be a Dict. Similarly to |++opt|, these entries are
recognized:
"ff" file format: "dos", "mac" or "unix"
"fileformat" idem
diff --git a/runtime/doc/testing.txt b/runtime/doc/testing.txt
index 458aa7c..9c87cba 100644
--- a/runtime/doc/testing.txt
+++ b/runtime/doc/testing.txt
@@ -1,4 +1,4 @@
-*testing.txt* For Vim version 8.2. Last change: 2020 Feb 22
+*testing.txt* For Vim version 8.2. Last change: 2020 Apr 10
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -107,7 +107,7 @@
test_null_function() *test_null_function()*
- Return a |FuncRef| that is null. Only useful for testing.
+ Return a |Funcref| that is null. Only useful for testing.
test_null_job() *test_null_job()*
diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index afa4022..c726921 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -1,4 +1,4 @@
-*todo.txt* For Vim version 8.2. Last change: 2020 Mar 27
+*todo.txt* For Vim version 8.2. Last change: 2020 Apr 10
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -39,9 +39,19 @@
-------------------- Known bugs and current work -----------------------
Vim9 script:
+func and partial types:
+- check using func type with default arguments and varargs.
+ func(type, type?, ...): rettype
+- Type checking arguments when calling :def function and test
+- Calling unknown user function does not give proper error message:
+ assert_equal('123text', RefDef2Arg()) typo for "RetDef2Arg"
- "func" inside "vim9script" doesn't work? (Ben Jackson, #5670)
-- "let x = x + 1" should say that "x" is not defined (declare local after
- evaluating expresion).
+- :func inside vim9script must still use a:arg
+- define function and create funcref in one step:
+ let ref = def(arg: type): rettype
+ body
+ enddef
+Also:
- "echo Func()" is an error if Func() does not return anything.
- better implementation for partial and tests for that.
- Make "g:imported = Export.exported" work in Vim9 script.
@@ -50,7 +60,6 @@
- Disallow unlet for local/script/imported vars
- Support type for ":let"/":const" at script level for Vim9 script.
(Ben Jackson, #5671)
-- :func inside vim9script must still use a:arg
- Make "++nr" work.
- Check that import in legacy script works and puts item in s:
- Error in any command in "vim9script" aborts sourcing.
@@ -60,23 +69,19 @@
- Test try/catch and throw better, also nested.
Test return inside try/finally jumps to finally and then returns.
- call autoload function.
-- Type checking arguments when calling :def function
- Implement more expressions, e.g. [a:b]
- can use func as reference:
def SomeFunc() ...
map(list, SomeFunc)
-- define function and create funcref in one step:
- let ref = def(arg: type): rettype
- Also extends lambda
- Test: Function declared inside a :def function is local, disappears at the
end of the function. Unless g: is used, just like with variables.
- Can we omit \ for line continuation inside (), {}, ?
Requires parsing while reading a function. Like fgetline in do_one_cmd()?
- implement :type
+- import type declaration?
- implement class
- implement interface
- predefined class: Promise<T>
-- import statement for type declaration?
- Make accessing varargs faster: arg[expr]
EVAL expr
LOADVARARG (varags idx)
@@ -106,6 +111,8 @@
- Figure out the size and position better if wrapping inserts indent
Text properties:
+- Patch to fix that split / join does not update properties properly (Axel
+ Forsman, #5839) Alternative: #5875.
- "cc" does not call inserted_bytes(). (Axel Forsman, #5763)
- Get E685 with a sequence of commands. (#5674)
- Combining text property with 'cursorline' does not always work (Billie
@@ -176,17 +183,22 @@
conversions.
Error numbers available:
-E451, E452, E453, E454, E460, E489, E491, E565, E578, E610, E611, E653,
+E453, E454, E460, E489, E491, E565, E578, E610, E611, E653,
E654, E856, E857, E861, E900
+Buffer autocommands are a bit inconsistent. Add a separate set of
+autocommands for the buffer lifecycle:
+ BufIsCreated (after buffer ID exists)
+ BufIsLoaded (after buffer ID has content)
+ BufIsUnloaded (after buffer ID no longer has)
+ BufIsWiped (after buffer ID was wiped)
+ BufIsRenamed (after buffer ID gets another name)
+The buffer list and windows are locked, no changes possible
+
Patch to fix drawing error with DirectX. (James Grant, #5688)
Causes flicker on resizing.
-Patch to make lambda functions faster (Ken Takata)
-https://github.com/vim/vim/pull/5727
- LGTM remark: size derived from user input (getenv). Don't see how.
-
-Patch to use more FOR_ALL_ macros and use them. (Yegappan Lakshmanan, #5339)
+In gvim always set t_Co to 16777216 (#5903)
Patch to explain use of "%" in :!. (David Briscoe, #5591)
diff --git a/runtime/doc/usr_22.txt b/runtime/doc/usr_22.txt
index 00c0007..bdba906 100644
--- a/runtime/doc/usr_22.txt
+++ b/runtime/doc/usr_22.txt
@@ -1,4 +1,4 @@
-*usr_22.txt* For Vim version 8.2. Last change: 2019 Dec 07
+*usr_22.txt* For Vim version 8.2. Last change: 2020 Mar 28
VIM USER MANUAL - by Bram Moolenaar
@@ -84,7 +84,7 @@
a................Hiding Files or Directories................|netrw-a|
mb...............Bookmarking a Directory....................|netrw-mb|
gb...............Changing to a Bookmarked Directory.........|netrw-gb|
- c................Make Browsing Directory The Current Dir....|netrw-c|
+ cd...............Make Browsing Directory The Current Dir....|netrw-c|
d................Make A New Directory.......................|netrw-d|
D................Deleting Files or Directories..............|netrw-D|
<c-h>............Edit File/Directory Hiding List............|netrw-ctrl-h|
@@ -121,7 +121,7 @@
As a sampling of extra normal-mode commands:
- c Change Vim's notion of the current directory to be
+ cd Change Vim's notion of the current directory to be
the same as the browser directory. (see
|g:netrw_keepdir| to control this, too)
R Rename the file or directory under the cursor; a
diff --git a/runtime/doc/vim9.txt b/runtime/doc/vim9.txt
index 1c18070..1337d4a 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 Apr 03
+*vim9.txt* For Vim version 8.2. Last change: 2020 Apr 09
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -120,6 +120,13 @@
Variables cannot shadow previously defined variables.
Variables may shadow Ex commands, rename the variable if needed.
+Global variables must be prefixed with "g:", also at the script level.
+However, global user defined functions are used without "g:". >
+ vim9script
+ let script_local = 'text'
+ let g:global = 'value'
+ let Funcref = ThatFunction
+
Since "&opt = value" is now assigning a value to option "opt", ":&" cannot be
used to repeat a `:substitute` command.
@@ -156,6 +163,18 @@
name will only be found when the call is executed.
+Omitting function() ~
+
+A user defined function can be used as a function reference in an expression
+without `function()`. The argument types and return type will then be checked.
+The function must already have been defined. >
+
+ let Funcref = MyFunction
+
+When using `function()` the resulting type is "func", a function with any
+number of arguments and any return type. The function can be defined later.
+
+
No curly braces expansion ~
|curly-braces-names| cannot be used.
@@ -213,8 +232,7 @@
blob non-empty
list non-empty (different from JavaScript)
dictionary non-empty (different from JavaScript)
- func when not NULL
- partial when not NULL
+ func when there is a function name
special v:true
job when not NULL
channel when not NULL
@@ -301,6 +319,7 @@
job
channel
func
+ func: {type}
func({type}, ...)
func({type}, ...): {type}
@@ -318,12 +337,22 @@
A partial and function can be declared in more or less specific ways:
func any kind of function reference, no type
- checking
+ checking for arguments or return value
func: {type} any number and type of arguments with specific
return type
-func({type} ...) function with argument types, does not return
+func({type}) function with argument type, does not return
a value
-func({type} ...): {type} function with argument types and return type
+func({type}): {type} function with argument type and return type
+func(?{type}) function with type of optional argument, does
+ not return a value
+func(...{type}) function with type of variable number of
+ arguments, does not return a value
+func({type}, ?{type}, ...{type}): {type}
+ function with:
+ - type of mandatory argument
+ - type of optional argument
+ - type of variable number of arguments
+ - return type
If the return type is "void" the function does not return a value.