diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-07-10 22:00:53 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-07-10 22:00:53 +0200 |
commit | 7ff78465f7057a672a6de0d75d56286da253501b (patch) | |
tree | e35e18d5462fab10968567970cb14cfe92a82bb7 /runtime/doc | |
parent | a7eedf317a806fceec1ddd8f9bebed6e00be0ed2 (diff) |
Update runtime files
Diffstat (limited to 'runtime/doc')
-rw-r--r-- | runtime/doc/channel.txt | 4 | ||||
-rw-r--r-- | runtime/doc/editing.txt | 6 | ||||
-rw-r--r-- | runtime/doc/eval.txt | 25 | ||||
-rw-r--r-- | runtime/doc/options.txt | 2 | ||||
-rw-r--r-- | runtime/doc/pattern.txt | 4 | ||||
-rw-r--r-- | runtime/doc/spell.txt | 13 | ||||
-rw-r--r-- | runtime/doc/syntax.txt | 4 | ||||
-rw-r--r-- | runtime/doc/tags | 3 | ||||
-rw-r--r-- | runtime/doc/testing.txt | 5 | ||||
-rw-r--r-- | runtime/doc/textprop.txt | 2 | ||||
-rw-r--r-- | runtime/doc/todo.txt | 52 | ||||
-rw-r--r-- | runtime/doc/usr_11.txt | 4 | ||||
-rw-r--r-- | runtime/doc/various.txt | 4 | ||||
-rw-r--r-- | runtime/doc/vim9.txt | 66 |
14 files changed, 123 insertions, 71 deletions
diff --git a/runtime/doc/channel.txt b/runtime/doc/channel.txt index e0e1c24f94..84a344fa95 100644 --- a/runtime/doc/channel.txt +++ b/runtime/doc/channel.txt @@ -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 @@ -1259,7 +1259,7 @@ can start typing a line. 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 -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 switch to the next window. This also works in Insert mode (use Shift-CTRL-W diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt index 57cbba176e..0998544763 100644 --- a/runtime/doc/editing.txt +++ b/runtime/doc/editing.txt @@ -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 @@ -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. 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 with "x" or by backspacing. - 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 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 - 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 the file. It is also possible that you get an "out of memory" error when reading the file. diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 08399b8e0c..38b2783da7 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 Jun 30 +*eval.txt* For Vim version 8.2. Last change: 2020 Jul 09 VIM REFERENCE MANUAL by Bram Moolenaar @@ -3036,7 +3036,8 @@ append({lnum}, {text}) *append()* :let failed = append(line('$'), "# THE END") :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) @@ -3058,7 +3059,8 @@ appendbufline({expr}, {lnum}, {text}) *appendbufline()* error message is given. Example: > :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) @@ -3902,6 +3904,7 @@ deepcopy({expr} [, {noref}]) *deepcopy()* *E698* changing an item in the copy does not change the contents of the original |List|. A |Dictionary| is copied in a similar way as a |List|. + When {noref} is omitted or zero a contained |List| or |Dictionary| is only copied once. All references point to 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 available return {default}. Return zero when {default} is omitted. - Can also be used as a |method|: > + Preferably used as a |method|: > mylist->get(idx) get({blob}, {idx} [, {default}]) Get byte {idx} from |Blob| {blob}. When this byte is not available return {default}. Return -1 when {default} is omitted. + Preferably used as a |method|: > + myblob->get(idx) get({dict}, {key} [, {default}]) Get item with key {key} from |Dictionary| {dict}. When this item is not available return {default}. Return zero when @@ -4851,6 +4856,8 @@ get({dict}, {key} [, {default}]) let val = get(g:, 'var_name', 'default') < This gets the value of g:var_name if it exists, and uses 'default' when it does not exist. + Preferably used as a |method|: > + mydict->get(key) get({func}, {what}) Get an item with from Funcref {func}. Possible values for {what} are: @@ -4858,7 +4865,9 @@ get({func}, {what}) "func" The function "dict" The dictionary "args" The list with arguments - + Preferably used as a |method|: > + myfunc->get(what) +< *getbufinfo()* getbufinfo([{expr}]) getbufinfo([{dict}]) @@ -9013,6 +9022,8 @@ setloclist({nr}, {list} [, {action} [, {what}]]) *setloclist()* Otherwise, same as |setqflist()|. Also see |location-list|. + For {action} see |setqflist-action|. + If the optional {what} dictionary argument is supplied, then only the items listed in {what} are set. Refer to |setqflist()| 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} argument is ignored. See below for the supported items in {what}. - + *setqflist-what* When {what} is not present, the items in {list} or used. Each item must be a dictionary. Non-dictionary items in {list} are 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 |getqflist()| returns. - {action} values: *E927* + {action} values: *setqflist-action* *E927* 'a' The items from {list} are added to the existing quickfix list. If there is no existing list, then a new list is created. diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 109fc1614d..37fdc84bcd 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 Jun 10 +*options.txt* For Vim version 8.2. Last change: 2020 Jul 05 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/pattern.txt b/runtime/doc/pattern.txt index 35c8c446df..b34389a7f1 100644 --- a/runtime/doc/pattern.txt +++ b/runtime/doc/pattern.txt @@ -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 @@ -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 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 character that includes this composing character. diff --git a/runtime/doc/spell.txt b/runtime/doc/spell.txt index 48dbffcbf7..1e33916cea 100644 --- a/runtime/doc/spell.txt +++ b/runtime/doc/spell.txt @@ -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 @@ -653,11 +653,12 @@ ask you where to write the file (there must be a writable directory in 'runtimepath' for this). 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 -g:spellfile_URL variable to the directory that holds the spell files. The -|netrw| plugin is used for getting the file, look there for the specific -syntax of the URL. Example: > - let g:spellfile_URL = 'http://ftp.vim.org/vim/runtime/spell' +server. The protocol used is SSL (https://) for security. If you want to use +another location or another protocol, set the g:spellfile_URL variable to the +directory that holds the spell files. You can use http:// or ftp://, but you +are taking a security risk then. The |netrw| plugin is used for getting the +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. The plugin will only ask about downloading a language once. If you want to diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index 8c2d35342e..2096a34b51 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -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 @@ -1403,7 +1403,7 @@ to your startup file. 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 Euphoria version 4.0.5 or later. diff --git a/runtime/doc/tags b/runtime/doc/tags index cfb8824f65..96022b70df 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -4699,6 +4699,7 @@ E855 autocmd.txt /*E855* E858 eval.txt /*E858* E859 eval.txt /*E859* E86 windows.txt /*E86* +E860 textprop.txt /*E860* E861 popup.txt /*E861* E862 eval.txt /*E862* E863 popup.txt /*E863* @@ -8820,7 +8821,9 @@ setloclist() eval.txt /*setloclist()* setmatches() eval.txt /*setmatches()* setpos() eval.txt /*setpos()* setqflist() eval.txt /*setqflist()* +setqflist-action eval.txt /*setqflist-action* setqflist-examples quickfix.txt /*setqflist-examples* +setqflist-what eval.txt /*setqflist-what* setreg() eval.txt /*setreg()* settabvar() eval.txt /*settabvar()* settabwinvar() eval.txt /*settabwinvar()* diff --git a/runtime/doc/testing.txt b/runtime/doc/testing.txt index 7ac2389eb8..b7825b90f9 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 Jun 15 +*testing.txt* For Vim version 8.2. Last change: 2020 Jul 09 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|: 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]) < *assert_equalfile()* diff --git a/runtime/doc/textprop.txt b/runtime/doc/textprop.txt index 0793940b6d..ac6d12a699 100644 --- a/runtime/doc/textprop.txt +++ b/runtime/doc/textprop.txt @@ -220,7 +220,7 @@ prop_list({lnum} [, {props}]) *prop_list()* Can also be used as a |method|: > GetLnum()->prop_list() < - *prop_remove()* *E968* + *prop_remove()* *E968* *E860* prop_remove({props} [, {lnum} [, {lnum-end}]]) Remove a matching text property from line {lnum}. When {lnum-end} is given, remove matching text properties from line diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index 95cf7a40e9..a04a5112b4 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 Jun 28 +*todo.txt* For Vim version 8.2. Last change: 2020 Jul 10 VIM REFERENCE MANUAL by Bram Moolenaar @@ -38,38 +38,22 @@ browser use: https://github.com/vim/vim/issues/1234 *known-bugs* -------------------- 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: -- "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. e.g. "'' == 0" does not give an error and evaluates to true. -- possible memory leak in test_vim9_func through compile_nested_function. -- memory leaks in test_vim9_expr -- memory leaks in test_vim9_script +- cannot put # comment after assert() in :def function - more return types depending on the first argument, like sort(). - 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 - 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 @@ -87,9 +71,10 @@ Making everything work: - Compile redir to local variable: var_redir_start(). - Compile builtin functions that access local variables: islocked() -- Expand `=expr` in :next, :argedit, :argadd, :argdelete, :drop -- Expand `=expr` in :vimgrep, :vimgrepadd, :lvimgrep, :lvimgrepadd -- Expand `=expr` in :mkspell +- possible memory leak in test_vim9_func through compile_nested_function. +- memory leaks in test_vim9_expr +- memory leaks in test_vim9_script +- memory leaks in test_vim9_cmd - When evaluating constants for script variables, some functions could work: has('asdf'), len('string') - 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(). (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. (Paul Jolly, #5656) 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" 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. (Sam Pagenkopf, 2017 Sep 14, #2090) diff --git a/runtime/doc/usr_11.txt b/runtime/doc/usr_11.txt index f8d0f15eb1..430c365cc3 100644 --- a/runtime/doc/usr_11.txt +++ b/runtime/doc/usr_11.txt @@ -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 @@ -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 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 file contains changes that you want to recover. diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt index 9fe8d616da..b0e5e8516b 100644 --- a/runtime/doc/various.txt +++ b/runtime/doc/various.txt @@ -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 @@ -754,7 +754,7 @@ up mappings to simulate the commands that less supports. Otherwise, you can still use the Vim commands. 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. The "h" key will give you a short overview of the available commands. diff --git a/runtime/doc/vim9.txt b/runtime/doc/vim9.txt index b14ff0b101..ad96817ff1 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 Jun 24 +*vim9.txt* For Vim version 8.2. Last change: 2020 Jul 10 VIM REFERENCE MANUAL by Bram Moolenaar @@ -64,16 +64,20 @@ 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 #. In Vi this is a command to list text with -numbers, but you can also use `:number` for that. > +In Vim script comments 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 +normally starts with #. In Vi this is a command to list text with numbers, +but you can also use `:number` for that. > let count = 0 # number of occurrences 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 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 ~ @@ -276,10 +280,13 @@ possible just before or after the operator. For example: > < *E1050* 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: > let result = start + print +Like this: > + let result = start + print + This will assign "start" and print a line: > let result = start :+ print @@ -291,8 +298,32 @@ arguments: > separator = '-' ): string -Note that "enddef" cannot be used at the start of a continuation line, it ends -the current function. +Notes: +- "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 ~ @@ -318,7 +349,8 @@ 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: > +White space must also be put before the # that starts a comment after a +command: > let var = 234# Error! let var = 234 # OK @@ -479,6 +511,22 @@ prefix. Note that for command line completion of {func} you 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* |