diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-12-23 13:56:35 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-12-23 13:56:35 +0100 |
commit | 4072ba571babd733d1800c082416fe8fe3c28ed7 (patch) | |
tree | 398563288ba4d793e4f2e6d819f292ff4bba2754 /runtime/doc | |
parent | 9f63a65f22b6a899925ba15adbb711e86251114e (diff) |
Update runtime files.
Diffstat (limited to 'runtime/doc')
-rw-r--r-- | runtime/doc/autocmd.txt | 4 | ||||
-rw-r--r-- | runtime/doc/editing.txt | 8 | ||||
-rw-r--r-- | runtime/doc/eval.txt | 12 | ||||
-rw-r--r-- | runtime/doc/helphelp.txt | 6 | ||||
-rw-r--r-- | runtime/doc/intro.txt | 4 | ||||
-rw-r--r-- | runtime/doc/options.txt | 8 | ||||
-rw-r--r-- | runtime/doc/starting.txt | 4 | ||||
-rw-r--r-- | runtime/doc/syntax.txt | 6 | ||||
-rw-r--r-- | runtime/doc/tags | 4 | ||||
-rw-r--r-- | runtime/doc/tagsrch.txt | 4 | ||||
-rw-r--r-- | runtime/doc/testing.txt | 9 | ||||
-rw-r--r-- | runtime/doc/todo.txt | 20 | ||||
-rw-r--r-- | runtime/doc/usr_23.txt | 18 | ||||
-rw-r--r-- | runtime/doc/usr_41.txt | 4 | ||||
-rw-r--r-- | runtime/doc/version5.txt | 4 | ||||
-rw-r--r-- | runtime/doc/vim9.txt | 40 | ||||
-rw-r--r-- | runtime/doc/windows.txt | 12 |
17 files changed, 108 insertions, 59 deletions
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt index a29c5dd584..dfd7dcb446 100644 --- a/runtime/doc/autocmd.txt +++ b/runtime/doc/autocmd.txt @@ -1,4 +1,4 @@ -*autocmd.txt* For Vim version 8.2. Last change: 2020 Dec 10 +*autocmd.txt* For Vim version 8.2. Last change: 2020 Dec 19 VIM REFERENCE MANUAL by Bram Moolenaar @@ -851,6 +851,8 @@ FuncUndefined When a user function is used but it isn't when it's used. The pattern is matched against the function name. Both <amatch> and <afile> are set to the name of the function. + Not triggered when compiling a |Vim9| + function. NOTE: When writing Vim scripts a better alternative is to use an autoloaded function. See |autoload-functions|. diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt index ab2219de85..7f30e54ae3 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 Oct 23 +*editing.txt* For Vim version 8.2. Last change: 2020 Dec 19 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1033,7 +1033,7 @@ original file fails, there will be an error message telling you that you lost the original file. *DOS-format-write* -If the 'fileformat' is "dos", <CR> <NL> is used for <EOL>. This is default +If the 'fileformat' is "dos", <CR><NL> is used for <EOL>. This is default for Win32. On other systems the message "[dos format]" is shown to remind you that an unusual <EOL> was used. *Unix-format-write* @@ -1419,8 +1419,8 @@ There are a few things to remember when editing binary files: the file. It is also possible that you get an "out of memory" error when reading the file. - Make sure the 'binary' option is set BEFORE loading the - file. Otherwise both <CR> <NL> and <NL> are considered to end a line - and when the file is written the <NL> will be replaced with <CR> <NL>. + file. Otherwise both <CR><NL> and <NL> are considered to end a line + and when the file is written the <NL> will be replaced with <CR><NL>. - <Nul> characters are shown on the screen as ^@. You can enter them with "CTRL-V CTRL-@" or "CTRL-V 000" - To insert a <NL> character in the file split a line. When writing the diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 9e81832a06..4c6636c614 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 Dec 02 +*eval.txt* For Vim version 8.2. Last change: 2020 Dec 22 VIM REFERENCE MANUAL by Bram Moolenaar @@ -4740,7 +4740,8 @@ fnamemodify({fname}, {mods}) *fnamemodify()* :echo fnamemodify("main.c", ":p:h") < results in: > /home/mool/vim/vim/src -< Note: Environment variables don't work in {fname}, use +< If {mods} is empty then {fname} is returned. + Note: Environment variables don't work in {fname}, use |expand()| first then. Can also be used as a |method|: > @@ -5143,7 +5144,10 @@ getchar([expr]) *getchar()* |xterm-bracketed-paste|. There is no prompt, you will somehow have to make clear to the - user that a character has to be typed. + user that a character has to be typed. The screen is not + redrawn, e.g. when resizing the window. When using a popup + window it should work better with a |popup-filter|. + There is no mapping for the character. Key codes are replaced, thus when the user presses the <Del> key you get the code for the <Del> key, not the raw character @@ -10842,6 +10846,8 @@ timer_start({time}, {callback} [, {options}]) function or a |Funcref|. It is called with one argument, which is the timer ID. The callback is only invoked when Vim is waiting for input. + If you want to show a message look at |popup_notification()| + to avoid intefering with what the user is doing. {options} is a dictionary. Supported entries: "repeat" Number of times to repeat calling the diff --git a/runtime/doc/helphelp.txt b/runtime/doc/helphelp.txt index 36e766e614..c724923e47 100644 --- a/runtime/doc/helphelp.txt +++ b/runtime/doc/helphelp.txt @@ -1,4 +1,4 @@ -*helphelp.txt* For Vim version 8.2. Last change: 2020 Dec 05 +*helphelp.txt* For Vim version 8.2. Last change: 2020 Dec 19 VIM REFERENCE MANUAL by Bram Moolenaar @@ -92,9 +92,9 @@ Help on help files *helphelp* :help k| only < Note that a space before the '|' is seen as part of the ":help" argument. - You can also use <LF> or <CR> to separate the help + You can also use <NL> or <CR> to separate the help command from a following command. You need to type - CTRL-V first to insert the <LF> or <CR>. Example: > + CTRL-V first to insert the <NL> or <CR>. Example: > :help so<C-V><CR>only :h[elp]! [subject] Like ":help", but in non-English help files prefer to diff --git a/runtime/doc/intro.txt b/runtime/doc/intro.txt index adeaa16c6e..c555dc29c6 100644 --- a/runtime/doc/intro.txt +++ b/runtime/doc/intro.txt @@ -1,4 +1,4 @@ -*intro.txt* For Vim version 8.2. Last change: 2020 Aug 15 +*intro.txt* For Vim version 8.2. Last change: 2020 Dec 19 VIM REFERENCE MANUAL by Bram Moolenaar @@ -434,7 +434,7 @@ notation meaning equivalent decimal value(s) ~ <CSI> command sequence intro ALT-Esc 155 *<CSI>* <xCSI> CSI when typed in the GUI *<xCSI>* -<EOL> end-of-line (can be <CR>, <LF> or <CR><LF>, +<EOL> end-of-line (can be <CR>, <NL> or <CR><NL>, depends on system and 'fileformat') *<EOL>* <Up> cursor-up *cursor-up* *cursor_up* diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 239ecb2e10..db62f8a34f 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 Oct 10 +*options.txt* For Vim version 8.2. Last change: 2020 Dec 21 VIM REFERENCE MANUAL by Bram Moolenaar @@ -2801,6 +2801,7 @@ A jump table for the options with a short description can be found at |Q_op|. toggled each time the flag is given. See |complex-change|. See also 'gdefault' option. Switching this option on may break plugins! + This option is not used in |Vim9| script. *'emoji'* *'emo'* *'noemoji'* *'noemo'* 'emoji' 'emo' boolean (default: on) @@ -3121,7 +3122,7 @@ A jump table for the options with a short description can be found at |Q_op|. local to buffer This gives the <EOL> of the current buffer, which is used for reading/writing the buffer from/to a file: - dos <CR> <NL> + dos <CR><NL> unix <NL> mac <CR> When "dos" is used, CTRL-Z at the end of a file is ignored. @@ -3570,6 +3571,7 @@ A jump table for the options with a short description can be found at |Q_op|. DEPRECATED: Setting this option may break plugins that are not aware of this option. Also, many users get confused that adding the /g flag has the opposite effect of that it normally does. + This option is not used in |Vim9| script. *'grepformat'* *'gfm'* 'grepformat' 'gfm' string (default "%f:%l:%m,%f:%l%m,%f %l%m") @@ -4943,6 +4945,8 @@ A jump table for the options with a short description can be found at |Q_op|. Only switch it off when working with old Vi scripts. In any other situation write patterns that work when 'magic' is on. Include "\M" when you want to |/\M|. + In |Vim9| script the value of 'magic' is ignored, patterns behave like + it is always set. *'makeef'* *'mef'* 'makeef' 'mef' string (default: "") diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index 9014a420fa..971181c555 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -1,4 +1,4 @@ -*starting.txt* For Vim version 8.2. Last change: 2020 Sep 23 +*starting.txt* For Vim version 8.2. Last change: 2020 Dec 19 VIM REFERENCE MANUAL by Bram Moolenaar @@ -996,7 +996,7 @@ version 5.0) are not recognized. MS-Windows line separators ~ -On MS-Windows, Vim assumes that all the vimrc files have <CR> <NL> pairs as +On MS-Windows, Vim assumes that all the vimrc files have <CR><NL> pairs as line separators. This will give problems if you have a file with only <NL>s and have a line like ":map xx yy^M". The trailing ^M will be ignored. diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index ad61a8bfe1..c171a20acf 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 Dec 04 +*syntax.txt* For Vim version 8.2. Last change: 2020 Dec 17 VIM REFERENCE MANUAL by Bram Moolenaar @@ -66,8 +66,8 @@ This command also sources the |menu.vim| script when the GUI is running or will start soon. See |'go-M'| about avoiding that. *:syn-on* *:syntax-on* -The `:syntax enable` command will keep your current color settings. This -allows using `:highlight` commands to set your preferred colors before or +The `:syntax enable` command will keep most of your current color settings. +This allows using `:highlight` commands to set your preferred colors before or after using this command. If you want Vim to overrule your settings with the defaults, use: > :syntax on diff --git a/runtime/doc/tags b/runtime/doc/tags index 4e58f65b5f..18e3d98afa 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -5151,10 +5151,13 @@ VIMINIT starting.txt /*VIMINIT* VMS os_vms.txt /*VMS* Vi intro.txt /*Vi* View starting.txt /*View* +Vim9 vim9.txt /*Vim9* VimEnter autocmd.txt /*VimEnter* VimLeave autocmd.txt /*VimLeave* VimLeavePre autocmd.txt /*VimLeavePre* VimResized autocmd.txt /*VimResized* +VimResume autocmd.txt /*VimResume* +VimSuspend autocmd.txt /*VimSuspend* Vimball-copyright pi_vimball.txt /*Vimball-copyright* Virtual-Replace-mode insert.txt /*Virtual-Replace-mode* VisVim if_ole.txt /*VisVim* @@ -10055,7 +10058,6 @@ vim-variable eval.txt /*vim-variable* vim.vim syntax.txt /*vim.vim* vim7 version7.txt /*vim7* vim8 version8.txt /*vim8* -vim9 vim9.txt /*vim9* vim9-classes vim9.txt /*vim9-classes* vim9-const vim9.txt /*vim9-const* vim9-declaration vim9.txt /*vim9-declaration* diff --git a/runtime/doc/tagsrch.txt b/runtime/doc/tagsrch.txt index bab1a1c5d7..f21bc9440c 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 Apr 19 +*tagsrch.txt* For Vim version 8.2. Last change: 2020 Dec 19 VIM REFERENCE MANUAL by Bram Moolenaar @@ -556,7 +556,7 @@ The first format is a normal tag, which is completely compatible with Vi. It is the only format produced by traditional ctags implementations. This is often used for functions that are global, also referenced in other files. -The lines in the tags file can end in <LF> or <CR><LF>. On the Macintosh <CR> +The lines in the tags file can end in <NL> or <CR><NL>. On the Macintosh <CR> also works. The <CR> and <NL> characters can never appear inside a line. The second format is new. It includes additional information in optional diff --git a/runtime/doc/testing.txt b/runtime/doc/testing.txt index 96446853c7..5be1890df8 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 Sep 06 +*testing.txt* For Vim version 8.2. Last change: 2020 Dec 12 VIM REFERENCE MANUAL by Bram Moolenaar @@ -308,8 +308,11 @@ assert_fails({cmd} [, {error} [, {msg} [, {lnum} [, {context}]]]]) first reported error: > assert_fails('cmd', ['E987:.*expected bool']) < The second pattern, if present, is matched against the last - reported error. To only match the last error use an empty - string for the first error: > + reported error. + If there is only one error then both patterns must match. This + can be used to check that there is only one error. + To only match the last error use an empty string for the first + error: > assert_fails('cmd', ['', 'E987:']) < If {msg} is empty then it is not used. Do this to get the diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index 2e65918db6..7a87de0604 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 Dec 10 +*todo.txt* For Vim version 8.2. Last change: 2020 Dec 22 VIM REFERENCE MANUAL by Bram Moolenaar @@ -38,6 +38,11 @@ browser use: https://github.com/vim/vim/issues/1234 *known-bugs* -------------------- Known bugs and current work ----------------------- +Rewrite the section on "magic". Say that 'magic' is normally on, then this +happens... If 'magic' is off, then this is different.. + +test_vim9_cmd: uses uninitialized var + Vim9 - Make everything work: - For an :autocmd and :command argument defined in Vim9 script, if a following line starts with "|" append it. It's like line continuation. (#6702) @@ -45,6 +50,7 @@ Vim9 - Make everything work: a range from "a" to "b"? To avoid confusion, require white space before (and after) the colon? #7409 - Implement "export {one, two three}". +- Use "null" for v:null, like true and false? #7495 - ISN_CHECKTYPE could use check_argtype() - Using a script variable inside a :def function doesn't work if the variable is inside a block, see Test_nested_function(). Should it work? @@ -62,6 +68,8 @@ Vim9 - Make everything work: map(list, SomeFunc) - For builtin functions using tv_get_string*() use check_for_string() to be more strict about the argument type. +- Allow function names that will be script-local to start with lower case + letter? - Support passing v:none to use the default argument value. (#6504) - Make map() give an error if the resulting type of the first argument is wrong. Only works if the type is known? Is this slow (need to go over all @@ -81,6 +89,7 @@ Vim9 - Make everything work: - Using ".." at script level doesn't convert arguments to a string. - Compile replacement of :s command: s/pat/\=expr/ - Compile redir to local variable: var_redir_start(). +- Implement type cast at the script level. - Compile builtin functions that access local variables: islocked() - When evaluating constants for script variables, some functions could work: @@ -127,6 +136,10 @@ Also: stack? - Make profiling work - Add ISN_PROFILE instructions after every line? - List commands when 'verbose' is set or :verbose is used. +Once Vim9 is stable: +- Change the help to prefer Vim9 syntax where appropriate +- Use Vim9 for runtime files. + PR #7497 for autoload/ccomplete.vim Further improvements: - compile options that are an expression, e.g. "expr:" in 'spellsuggest', 'foldexpr', 'foldtext', 'printexpr', 'diffexpr', 'patchexpr', 'charconvert', @@ -1273,9 +1286,6 @@ Once .exe with updated installer is available: Add remark to download page about /S and /D options (Ken Takata, 2016 Apr 13) Or point to nightly builds: https://github.com/vim/vim-win32-installer/releases -Problem passing non-UTF-8 strings to Python 3. (Björn Linse, 2016 Sep 11, -#1053) With patch, does it work? - ":sbr" docs state it respects 'switchbuf', but "vsplit" does not cause a vertical split. (Haldean Brown, 2017 Mar 1) @@ -3998,8 +4008,6 @@ Documentation: - if it can be undone (u/CTRL-R) and redone (.) - how it works for folded lines - how it works with multibyte characters -9 In change.txt, remark about Javadoc isn't right. Right alignment would - work too. 8 Spread the windows commands over the other files. For example, ":stag" should be with ":tag". Cross-link with tags to avoid too much double text. diff --git a/runtime/doc/usr_23.txt b/runtime/doc/usr_23.txt index b124b349de..def737c0bf 100644 --- a/runtime/doc/usr_23.txt +++ b/runtime/doc/usr_23.txt @@ -1,4 +1,4 @@ -*usr_23.txt* For Vim version 8.2. Last change: 2006 Apr 24 +*usr_23.txt* For Vim version 8.2. Last change: 2020 Dec 19 VIM USER MANUAL - by Bram Moolenaar @@ -28,9 +28,9 @@ start a new line. One to move the carriage back to the first position (carriage return, <CR>), another to move the paper up (line feed, <LF>). When computers came out, storage was expensive. Some people decided that they did not need two characters for end-of-line. The UNIX people decided -they could use <Line Feed> only for end-of-line. The Apple people -standardized on <CR>. The Microsoft Windows folks decided to keep -the old <CR><LF>. +they could use <New Line> or <NL> only for end-of-line. The Apple people +standardized on <CR>. The Microsoft Windows folks decided to keep the old +<CR><NL> (we use <NL> for line feed in the help text). This means that if you try to move a file from one system to another, you have line-break problems. The Vim editor automatically recognizes the different file formats and handles things properly behind your back. @@ -55,20 +55,20 @@ which format you have, execute the following command: > The three names that Vim uses are: - unix <LF> - dos <CR><LF> + unix <NL> + dos <CR><NL> mac <CR> USING THE MAC FORMAT -On Unix, <LF> is used to break a line. It's not unusual to have a <CR> +On Unix, <NL> is used to break a line. It's not unusual to have a <CR> character halfway a line. Incidentally, this happens quite often in Vi (and Vim) scripts. On the Macintosh, where <CR> is the line break character, it's possible to -have a <LF> character halfway a line. +have a <NL> character halfway a line. The result is that it's not possible to be 100% sure whether a file -containing both <CR> and <LF> characters is a Mac or a Unix file. Therefore, +containing both <CR> and <NL> characters is a Mac or a Unix file. Therefore, Vim assumes that on Unix you probably won't edit a Mac file, and doesn't check for this type of file. To check for this format anyway, add "mac" to 'fileformats': > diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt index 126dbc4b48..a19d005631 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: 2020 Nov 09 +*usr_41.txt* For Vim version 8.2. Last change: 2020 Dec 19 VIM USER MANUAL - by Bram Moolenaar @@ -1765,7 +1765,7 @@ Here is a summary of items that apply to Vim scripts. They are also mentioned elsewhere, but form a nice checklist. The end-of-line character depends on the system. For Unix a single <NL> -character is used. For MS-Windows and the like, <CR><LF> is used. This is +character is used. For MS-Windows and the like, <CR><NL> is used. This is important when using mappings that end in a <CR>. See |:source_crnl|. diff --git a/runtime/doc/version5.txt b/runtime/doc/version5.txt index 803d743638..2b44cbda77 100644 --- a/runtime/doc/version5.txt +++ b/runtime/doc/version5.txt @@ -1,4 +1,4 @@ -*version5.txt* For Vim version 8.2. Last change: 2020 Sep 02 +*version5.txt* For Vim version 8.2. Last change: 2020 Dec 19 VIM REFERENCE MANUAL by Bram Moolenaar @@ -805,7 +805,7 @@ Using "~" for $HOME now works for all systems. |$HOME| Unix: Besides using CTRL-C, also use the INTR character from the tty settings. Somebody has INTR set to DEL. -Allow a <LF> in a ":help" command argument to end the help command, so another +Allow a <NL> in a ":help" command argument to end the help command, so another command can follow. Doing "%" on a line that starts with " #if" didn't jump to matching "#else". diff --git a/runtime/doc/vim9.txt b/runtime/doc/vim9.txt index 1872b82ee2..9458ad9d03 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 Dec 05 +*vim9.txt* For Vim version 8.2. Last change: 2020 Dec 23 VIM REFERENCE MANUAL by Bram Moolenaar @@ -6,7 +6,7 @@ THIS IS STILL UNDER DEVELOPMENT - ANYTHING CAN BREAK - ANYTHING CAN CHANGE -Vim9 script commands and expressions. *vim9* +Vim9 script commands and expressions. *Vim9* Most expression help is in |eval.txt|. This file is about the new syntax and features in Vim9 script. @@ -134,7 +134,7 @@ Compilation is done when either of these is encountered: `:def` has no options like `:function` does: "range", "abort", "dict" or "closure". A `:def` function always aborts on an error (unless `:silent!` was used for the command or inside a `:try` block), does not get a range passed -and cannot be a "dict" function. +cannot be a "dict" function, and can always be a closure. 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 @@ -187,6 +187,11 @@ 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. +When compiling a function and a function call is encountered for a function +that is not (yet) defined, the |FuncUndefined| autocommand is not triggered. +You can use an autoload function if needed, or call a legacy function and have +|FuncUndefined| triggered there. + Variable declarations with :var, :final and :const ~ *vim9-declaration* *:var* @@ -399,6 +404,16 @@ arguments: > separator = '-' ): string +Since a continuation line cannot be easily recognized the parsing of commands +has been made sticter. E.g., because of the error in the first line, the +second line is seen as a separate command: > + popup_create(some invalid expression, { + exit_cb: Func}) +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. + + Notes: - "enddef" cannot be used at the start of a continuation line, it ends the current function. @@ -626,6 +641,13 @@ command. This will give an error for missing `endif`: > if has('feature') | use-feature | endif enddef +Other differences ~ + +Patterns are used like 'magic' is set, unless explicitly overruled. +The 'edcompatible' option value is not used. +The 'gdefault' option value is not used. + + ============================================================================== 3. New style functions *fast-functions* @@ -795,12 +817,14 @@ compiled code the "any" type is assumed. This can be a problem when the "any" type is undesired and the actual type is expected to always be the same. For example, when declaring a list: > var l: list<number> = [1, g:two] -This will give an error, because "g:two" has type "any". To avoid this, use a -type cast: > +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* +To avoid this, use a type cast: > var l: list<number> = [1, <number>g:two] -< *type-casting* -The compiled code will then check that "g:two" is a number at runtime and give -an error if it isn't. This is called type casting. +The compiled code will then only check that "g:two" is a number and give an +error if it isn't. This is called type casting. The syntax of a type cast is: "<" {type} ">". There cannot be white space after the "<" or before the ">" (to avoid them being confused with diff --git a/runtime/doc/windows.txt b/runtime/doc/windows.txt index 2a1c10bc5f..0e0d9d5ef6 100644 --- a/runtime/doc/windows.txt +++ b/runtime/doc/windows.txt @@ -1,4 +1,4 @@ -*windows.txt* For Vim version 8.2. Last change: 2020 Nov 07 +*windows.txt* For Vim version 8.2. Last change: 2020 Dec 18 VIM REFERENCE MANUAL by Bram Moolenaar @@ -205,11 +205,6 @@ CTRL-W CTRL_N *CTRL-W_CTRL-N* This behaves like a ":split" first, and then an ":enew" command. -:[N]vne[w] [++opt] [+cmd] [file] *:vne* *:vnew* - Like |:new|, but split vertically. If 'equalalways' is set - and 'eadirection' isn't "ver" the windows will be spread out - horizontally, unless a width was specified. - :[N]new [++opt] [+cmd] {file} :[N]sp[lit] [++opt] [+cmd] {file} *:split_f* Create a new window and start editing file {file} in it. This @@ -221,6 +216,11 @@ CTRL-W CTRL_N *CTRL-W_CTRL-N* height). Reduces the current window height to create room (and others, if the 'equalalways' option is set). +:[N]vne[w] [++opt] [+cmd] [file] *:vne* *:vnew* + Like |:new|, but split vertically. If 'equalalways' is set + and 'eadirection' isn't "ver" the windows will be spread out + horizontally, unless a width was specified. + :[N]sv[iew] [++opt] [+cmd] [file] *:sv* *:sview* *splitview* Same as ":split", but set 'readonly' option for this buffer. |