# HG changeset patch # User Bram Moolenaar # Date 1590521404 -7200 # Node ID 74e3316c1d5a4c573c3d14a706da33a4ad9eaeb8 # Parent f1b23a9643fe6389579441b77e90d5c8798f1e78 Update runtime files Commit: https://github.com/vim/vim/commit/388a5d4f20b4b64341d1604aa238cab85827b892 Author: Bram Moolenaar Date: Tue May 26 21:20:45 2020 +0200 Update runtime files diff --git a/runtime/compiler/eslint.vim b/runtime/compiler/eslint.vim new file mode 100644 --- /dev/null +++ b/runtime/compiler/eslint.vim @@ -0,0 +1,16 @@ +" Vim compiler file +" Compiler: ESLint for JavaScript +" Maintainer: Romain Lafourcade +" Last Change: 2020 May 17 + +if exists("current_compiler") + finish +endif +let current_compiler = "eslint" + +if exists(":CompilerSet") != 2 + command -nargs=* CompilerSet setlocal +endif + +CompilerSet makeprg=eslint\ --format\ compact +CompilerSet errorformat=%f:\ line\ %l\\,\ col\ %c\\,\ %m,%-G%.%# diff --git a/runtime/compiler/standard.vim b/runtime/compiler/standard.vim new file mode 100644 --- /dev/null +++ b/runtime/compiler/standard.vim @@ -0,0 +1,16 @@ +" Vim compiler file +" Compiler: Standard for JavaScript +" Maintainer: Romain Lafourcade +" Last Change: 2020 May 17 + +if exists("current_compiler") + finish +endif +let current_compiler = "standard" + +if exists(":CompilerSet") != 2 + command -nargs=* CompilerSet setlocal +endif + +CompilerSet makeprg=standard +CompilerSet errorformat=%f:\ line\ %l\\,\ col\ %c\\,\ %m,%-G%.%# diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 8.2. Last change: 2020 Apr 19 +*eval.txt* For Vim version 8.2. Last change: 2020 May 25 VIM REFERENCE MANUAL by Bram Moolenaar @@ -584,6 +584,8 @@ adict. Weeding out entries from a Dictionary can be done with |filter()|: > :call filter(dict, 'v:val =~ "x"') This removes all entries from "dict" with a value not matching 'x'. +This can also be used to remove all entries: > + call filter(dict, 0) Dictionary function ~ @@ -1485,7 +1487,7 @@ the function returns: > :echo Bar(6) < 5 -Note that the variables must exist in the outer scope before the lamba is +Note that the variables must exist in the outer scope before the lambda is defined for this to work. See also |:func-closure|. Lambda and closure support can be checked with: > @@ -2916,6 +2918,7 @@ win_splitmove({nr}, {target} [, {options Number move window {nr} to split of {target} winbufnr({nr}) Number buffer number of window {nr} wincol() Number window column of the cursor +windowsversion() String MS-Windows OS version winheight({nr}) Number height of window {nr} winlayout([{tabnr}]) List layout of windows in tab {tabnr} winline() Number window line of the cursor @@ -10221,7 +10224,7 @@ tr({src}, {fromstr}, {tostr}) *tr()* trim({text} [, {mask}]) *trim()* Return {text} as a String where any character in {mask} is - removed from the beginning and end of {text}. + removed from the beginning and end of {text}. If {mask} is not given, {mask} is all characters up to 0x20, which includes Tab, space, NL and CR, plus the non-breaking space character 0xa0. @@ -11144,6 +11147,8 @@ See |:verbose-cmd| for more information. NOTE: Use ! wisely. If used without care it can cause an existing function to be replaced unexpectedly, which is hard to debug. + NOTE: In Vim9 script script-local functions cannot be + deleted or redefined. For the {arguments} see |function-argument|. diff --git a/runtime/doc/if_lua.txt b/runtime/doc/if_lua.txt --- a/runtime/doc/if_lua.txt +++ b/runtime/doc/if_lua.txt @@ -1,4 +1,4 @@ -*if_lua.txt* For Vim version 8.2. Last change: 2019 Jul 21 +*if_lua.txt* For Vim version 8.2. Last change: 2020 May 17 VIM REFERENCE MANUAL by Luis Carvalho diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt --- a/runtime/doc/index.txt +++ b/runtime/doc/index.txt @@ -1,4 +1,4 @@ -*index.txt* For Vim version 8.2. Last change: 2020 May 10 +*index.txt* For Vim version 8.2. Last change: 2020 May 26 VIM REFERENCE MANUAL by Bram Moolenaar @@ -828,7 +828,7 @@ tag char note action in Normal mo |zD| zD delete folds recursively |zE| zE eliminate all folds |zF| zF create a fold for N lines -|zG| zG mark word as good spelled word +|zG| zG temporarily mark word as good spelled word |zH| zH when 'wrap' off scroll half a screenwidth to the right |zL| zL when 'wrap' off scroll half a screenwidth @@ -837,7 +837,7 @@ tag char note action in Normal mo |zN| zN set 'foldenable' |zO| zO open folds recursively |zR| zR set 'foldlevel' to the deepest fold -|zW| zW mark word as wrong (bad) spelled word +|zW| zW temporarily mark word as bad spelled word |zX| zX re-apply 'foldlevel' |z^| z^ cursor on line N (default line above window), otherwise like "z-" @@ -849,7 +849,7 @@ tag char note action in Normal mo position the cursor at the end (right side) of the screen |zf| zf{motion} create a fold for Nmove text -|zg| zg mark word as good spelled word +|zg| zg permanently mark word as good spelled word |zh| zh when 'wrap' off scroll screen N characters to the right |zi| zi toggle 'foldenable' @@ -870,7 +870,7 @@ tag char note action in Normal mo |zuW| zuW undo |zW| |zuG| zuG undo |zG| |zv| zv open enough folds to view the cursor line -|zw| zw mark word as wrong (bad) spelled word +|zw| zw permanently mark word as bad spelled word |zx| zx re-apply 'foldlevel' and do "zv" |zz| zz redraw, cursor line at center of window |z| z same as "zh" @@ -1262,6 +1262,7 @@ tag command action ~ |:debug| :deb[ug] run a command in debugging mode |:debuggreedy| :debugg[reedy] read debug mode commands from normal input |:def| :def define a Vim9 user function +|:defcompile| :defc[ompile] compile Vim9 user functions in current script |:delcommand| :delc[ommand] delete user-defined command |:delfunction| :delf[unction] delete a user function |:delmarks| :delm[arks] delete marks diff --git a/runtime/doc/makehtml.awk b/runtime/doc/makehtml.awk --- a/runtime/doc/makehtml.awk +++ b/runtime/doc/makehtml.awk @@ -58,7 +58,7 @@ substr($0,length($0),1) == "~" { print " # #ad hoc code # -/^"\|\& / {gsub(/\|/,"\\|"); } +/^"\|& / {gsub(/\|/,"\\|"); } / = b / {gsub(/ b /," \\b "); } # # one letter tag diff --git a/runtime/doc/os_haiku.txt b/runtime/doc/os_haiku.txt --- a/runtime/doc/os_haiku.txt +++ b/runtime/doc/os_haiku.txt @@ -1,4 +1,4 @@ -*os_haiku.txt* For Vim version 8.2. Last change: 2020 Apr 30 +*os_haiku.txt* For Vim version 8.2. Last change: 2020 May 13 VIM REFERENCE MANUAL by Bram Moolenaar @@ -84,9 +84,6 @@ Stuff that does not work yet: in when the window is activated or deactivated (so it works best with focus- follows-mouse turned on). - The cursor does not flash. -- Built-in terminal is not available in GUI, and does not work reliably on - console version as well; e.g. it is not possible to exit using the 'exit' - command. If you need to use it, enable at your own risk. 4. The $VIM directory *haiku-vimdir* diff --git a/runtime/doc/popup.txt b/runtime/doc/popup.txt --- a/runtime/doc/popup.txt +++ b/runtime/doc/popup.txt @@ -1,4 +1,4 @@ -*popup.txt* For Vim version 8.2. Last change: 2020 May 12 +*popup.txt* For Vim version 8.2. Last change: 2020 May 18 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt --- a/runtime/doc/repeat.txt +++ b/runtime/doc/repeat.txt @@ -1,4 +1,4 @@ -*repeat.txt* For Vim version 8.2. Last change: 2020 Apr 26 +*repeat.txt* For Vim version 8.2. Last change: 2020 May 14 VIM REFERENCE MANUAL by Bram Moolenaar @@ -126,6 +126,11 @@ q{0-9a-zA-Z"} Record typed characters i recorded macro and the yank will overwrite the recorded macro. + Note: The recording happens while you type, replaying + the register happens as if the keys come from a + mapping. This matters, for example, for undo, which + only syncs when commands were typed. + q Stops recording. (Implementation note: The 'q' that stops recording is not stored in the register, unless it was the result of a mapping) @@ -137,7 +142,7 @@ q Stops recording. (Implementation no used. The register is executed like a mapping, that means that the difference between 'wildchar' and 'wildcharm' - applies. + applies, and undo might not be synced in the same way. For "@=" you are prompted to enter an expression. The result of the expression is then executed. See also |@:|. diff --git a/runtime/doc/tags b/runtime/doc/tags --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -2317,6 +2317,8 @@ 90.5 usr_90.txt /*90.5* :debugg repeat.txt /*:debugg* :debuggreedy repeat.txt /*:debuggreedy* :def vim9.txt /*:def* +:defc vim9.txt /*:defc* +:defcompile vim9.txt /*:defcompile* :del change.txt /*:del* :delc map.txt /*:delc* :delcommand map.txt /*:delcommand* @@ -4253,6 +4255,7 @@ E457 print.txt /*E457* E458 message.txt /*E458* E459 message.txt /*E459* E46 message.txt /*E46* +E460 eval.txt /*E460* E461 eval.txt /*E461* E462 editing.txt /*E462* E463 netbeans.txt /*E463* @@ -4678,6 +4681,7 @@ E855 autocmd.txt /*E855* E858 eval.txt /*E858* E859 eval.txt /*E859* E86 windows.txt /*E86* +E861 popup.txt /*E861* E862 eval.txt /*E862* E863 popup.txt /*E863* E864 pattern.txt /*E864* @@ -7700,6 +7704,7 @@ mapmode-v map.txt /*mapmode-v* mapmode-x map.txt /*mapmode-x* mapping map.txt /*mapping* mapping-functions usr_41.txt /*mapping-functions* +mapset() eval.txt /*mapset()* mark motion.txt /*mark* mark-functions usr_41.txt /*mark-functions* mark-motions motion.txt /*mark-motions* @@ -8383,6 +8388,7 @@ popup_findpreview() popup.txt /*popup_fi popup_getoptions() popup.txt /*popup_getoptions()* popup_getpos() popup.txt /*popup_getpos()* popup_hide() popup.txt /*popup_hide()* +popup_list() popup.txt /*popup_list()* popup_locate() popup.txt /*popup_locate()* popup_menu() popup.txt /*popup_menu()* popup_menu-shortcut-example popup.txt /*popup_menu-shortcut-example* @@ -9460,6 +9466,7 @@ termdebug-prompt terminal.txt /*termdebu termdebug-starting terminal.txt /*termdebug-starting* termdebug-stepping terminal.txt /*termdebug-stepping* termdebug-variables terminal.txt /*termdebug-variables* +termdebug_map_K terminal.txt /*termdebug_map_K* termdebug_popup terminal.txt /*termdebug_popup* termdebug_shortcuts terminal.txt /*termdebug_shortcuts* termdebug_use_prompt terminal.txt /*termdebug_use_prompt* diff --git a/runtime/doc/terminal.txt b/runtime/doc/terminal.txt --- a/runtime/doc/terminal.txt +++ b/runtime/doc/terminal.txt @@ -1,4 +1,4 @@ -*terminal.txt* For Vim version 8.2. Last change: 2020 Apr 23 +*terminal.txt* For Vim version 8.2. Last change: 2020 May 24 VIM REFERENCE MANUAL by Bram Moolenaar @@ -161,6 +161,7 @@ terminal windows may be configured using hexadecimal color codes, similar to those accepted by |highlight-guifg|. When not using GUI colors, the terminal window always uses the 16 ANSI colors of the underlying terminal. +When using `term_start()` the colors can be set with the "ansi_colors" option. The |term_setansicolors()| function can be used to change the colors, and |term_getansicolors()| to get the currently used colors. @@ -1305,7 +1306,7 @@ breakpoint, or use the "Clear breakpoint Inspecting variables ~ *termdebug-variables* *:Evaluate* `:Evaluate` evaluate the expression under the cursor - `K` same + `K` same (see |termdebug_map_K| to disable) `:Evaluate` {expr} evaluate {expr} `:'<,'>Evaluate` evaluate the Visually selected text @@ -1336,6 +1337,10 @@ in a buffer with 'buftype' set to "promp *termdebug_use_prompt* Prompt mode can be used even when the |+terminal| feature is present with: > let g:termdebug_use_prompt = 1 +< + *termdebug_map_K* +The K key is normally mapped to :Evaluate. If you do not want this use: > + let g:termdebug_map_K = 0 Communication ~ diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1,4 +1,4 @@ -*todo.txt* For Vim version 8.2. Last change: 2020 May 11 +*todo.txt* For Vim version 8.2. Last change: 2020 May 26 VIM REFERENCE MANUAL by Bram Moolenaar @@ -38,27 +38,19 @@ browser use: https://github.com/vim/vim/ *known-bugs* -------------------- Known bugs and current work ----------------------- -Patch to test TERM signal. (Dominique, #6055) - -Include src/po/vim.pot +Include src/po/vim.pot ? Vim9 script: -Make closures work: - - call closure from not compiled context - - Create closure in a loop. Need to make a list of them. -Forward declarations: - - Cleanup when sourcing a script again: all script-local variables, imports - and functions are deleted. - - make sure only constants in declarations are executed, no function calls. - - Declare a variable at script level without an assignment. - let var: string - Error without a type or assignment - let var # error! Making everything work: +- possible memory leak in test_vim9_func through compile_nested_function. +- memory leaks in test_vim9_expr +- memory leaks in test_vim9_script - Test that a script-local function in Vim9 script cannot be deleted. +- 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 defined. +- make 0 == 'string' fail on the script level, like inside :def. - Check that when using a user function name without prefix, it does not find a global function. Prefixing g: is required. - Compile: let [var, var] = expr @@ -75,16 +67,21 @@ Making everything work: - Expand `=expr` in :next, :argedit, :argadd, :argdelete, :drop - Expand `=expr` in :vimgrep, :vimgrepadd, :lvimgrep, :lvimgrepadd - Expand `=expr` in :mkspell +- 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. (Ben Jackson, #5671) Can we share the code from ex_let_const() between direct execution and compiling? - Disallow unlet for local/script/imported vars - Make "++nr" work. +- Make closures work: + - Create closure in a loop. Need to make a list of them. - expandcmd() with `=expr` in filename uses legacy expression. - eval_expr() in ex_cexpr() - eval_expr() call in dbg_parsearg() and debuggy_find() -- Make "true" and "false" work in vim9script +- has() is compiled as a constant, but some checks are dynamic. + Check for dynamic values, such as "gui_running". New syntax and functionality: Improve error checking: - "echo Func()" is an error if Func() does not return anything. @@ -113,6 +110,7 @@ Also: - implement class - implement interface - predefined class: Promise +- implement enum - Make accessing varargs faster: arg[expr] EVAL expr LOADVARARG (varags idx) @@ -125,10 +123,12 @@ Further improvements: body enddef - compile get_lambda_tv() in popup_add_timeout() +- inline call to map() and filter() - compile "skip" argument of searchpair() - compile "expr" and "call" expression of a channel in channel_exe_cmd()? Popup windows: +- Can put focus in another window using API and "drop". (#6077) - With some sequence get get hidden finished terminal buffer. (#5768) Cannot close popup terminal (#5744) Buffer can't be wiped, gets status "aF". (#5764) @@ -201,8 +201,12 @@ Terminal emulator window: background process, the window remains open, because the channel still exists (and output still shows). Perhaps close the window when an explicit ++close was used? (#5931) +- Using "CTRL-W :confirm quite" and selecting "yes" should work like ":quit!". + (Harm te Hennepe, #6129) - When the job in the terminal doesn't use mouse events, let the scroll wheel scroll the scrollback, like a terminal does at the shell prompt. #2490 + A bit like using CTRL-W N first. + Jump back like with "a" when any key is typed. And use modeless selection. #2962 - Use CTRL-W CTRL-K to enter a digraph? #5371 - When Vim runs in the terminal and changes the title, the statusline needs to @@ -232,8 +236,10 @@ Terminal emulator window: conversions. Error numbers available: -E453, E454, E460, E489, E491, E610, E611, E653, -E856, E857, E861, E900 +E453, E454, E489, E610, E611, E653, E856, E857, E861, E900 + +Patch to fix that typval related code is spread out. (Yegappan Lakshmanan, +#6093) Buffer autocommands are a bit inconsistent. Add a separate set of autocommands for the buffer lifecycle: @@ -254,6 +260,10 @@ Patch to explain use of "%" in :!. (Dav Patch to improve Windows terminal support. (Nobuhiro Takasaki, #5546) Ready to include. +Patch to improve use of Lua path. (Prabir Shrestha, #6098) + +Patch to make exepath() work better on MS-Windows. (#6115) + Patch to add "-d" to xxd. (#5616) Patch for the Haiku port: #5961 @@ -271,12 +281,17 @@ Patch to support different color for und Patch to support cindent option to handle pragmas differently. (Max Rumpf, #5468) +Patch to add ":syn foldlevel" to use fold level further down the line. +(Brad King, 2016 Oct 19, update 2017 Jan 30, now in #6087) + File marks merging has duplicates since 7.4.1925. (Ingo Karkat, #5733) -Running test_gui and test_gui_init with Motif sometimes kills the window -manager. Problem with Motif? Now test_gui crashes in submenu_change(). +"make test_gui" crashed in submenu_change(). Fix and remove workaround in +add_pixmap_args(). Athena is OK. Motif: Build on Ubuntu can't enter any text in dialog text fields. +Running test_gui and test_gui_init with Motif sometimes kills the window +manager. Problem with Motif? :map output does not clear the reset of the command line. (#5623, also see #5962) @@ -287,6 +302,9 @@ Flag in 'formatoptions' is not used in t Patch to add 'vtp' option. (#5344) Needs better docs. Is there a better name? +Patch to add argument to trim() to only trim start or end of a string. +(Yegappan, #6126) + undo result wrong: Masato Nishihata, #4798 Patch for Template string: #4491. New pull: #4634 @@ -300,6 +318,14 @@ Patch to delete BeOS code. (#5817) Anyo With bash ":make" does not set v:shell_error. Possible solution: set 'shellpipe' to "2>&1| tee %s; exit ${PIPESTATUS[0]}" #5994 +Using mode() when "/pat" is used in Visual mode returns "v" instead of "c", +which is not useful. Return "c/v" instead. And "c/o" when using "d/pat". +#6127 + +When 'fileignorecase' is set ":e testfile.c" works to edit TestFile.c, but +":find testfile.c" does not ignore case. +Might be related to #6088. + 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) @@ -319,6 +345,8 @@ Patch to add function to return the text Patch to add readdirex() (Ken Takata, #5619) +Wrong error when using local arglist. (Harm te Hennepe, #6133) + Request to support in mappings, similar to how Neovim does this. (Daniel Hahler, #4784) @@ -389,6 +417,9 @@ support combining characters. (Charles C Add "t" action to settagstack(): truncate and add new entries. (#5405) +When 'relativenumber' is set the line just below a diff change doesn't get +updated. (#6138) + Result of synID() sometimes wrong in help files. (#5252) Status line is nut updated when splitting windows. (Marcin Szamotulski, #5496) @@ -1329,6 +1360,8 @@ 4#1038) - Add ch_readlines(): for a channel in NL mode, reads as many lines as are available. Should be more efficient than looping over ch_read() with ch_status() to check for more. +- If buffer contents is changed in a callback, set w_redr_status so that it + gets redrawn in redraw_after_callback(). #6120 - Add a separate timeout for opening a socket. Currently it's fixed at 50 msec, which is too small for a remote connection. (tverniquet, #2130) - Problem with stderr on Windows? (Vincent Rischmann, 2016 Aug 31, #1026) @@ -1452,9 +1485,6 @@ Also with latest version. Cannot delete a file with square brackets with delete(). (#696) -Patch to add ":syn foldlevel" to use fold level further down the line. -(Brad King, 2016 Oct 19, update 2017 Jan 30) - Completion for input() does not expand environment variables. (chdiza, 2016 Jul 25, #948) diff --git a/runtime/doc/vim9.txt b/runtime/doc/vim9.txt --- a/runtime/doc/vim9.txt +++ b/runtime/doc/vim9.txt @@ -1,4 +1,4 @@ -*vim9.txt* For Vim version 8.2. Last change: 2020 May 09 +*vim9.txt* For Vim version 8.2. Last change: 2020 May 25 VIM REFERENCE MANUAL by Bram Moolenaar @@ -41,9 +41,10 @@ A secondary goal is to avoid Vim-specifi commonly used programming languages, such as JavaScript, TypeScript and Java. The performance improvements can only be achieved by not being 100% backwards -compatible. For example, in a function the arguments are not available in the -"a:" dictionary, because creating that dictionary adds quite a lot of -overhead. Other differences are more subtle, such as how errors are handled. +compatible. For example, making function arguments available in the +"a:" dictionary adds quite a lot of overhead. In a Vim9 function this +dictionary is not available. Other differences are more subtle, such as how +errors are handled. The Vim9 script syntax and semantics are used in: - a function defined with the `:def` command @@ -79,12 +80,16 @@ Vim9 functions ~ A function defined with `:def` is compiled. Execution is many times faster, often 10x to 100x times. -Many errors are already found when compiling, before the function is called. +Many errors are already found when compiling, before the function is executed. The syntax is strict, to enforce code that is easy to read and understand. -`:def` has no extra arguments like `:function` does: "range", "abort", "dict" -or "closure". A `:def` function always aborts on an error, does not get a -range passed and cannot be a "dict" function. +Compilation is done when the function is first called, or when the +`:defcompile` command is encountered in the script where the function was +defined. + +`:def` has no options like `:function` does: "range", "abort", "dict" or +"closure". A `:def` function always aborts on an error, does not get a range +passed and cannot be a "dict" function. 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 @@ -118,8 +123,8 @@ search for the function in this order: - Local to the current scope and outer scopes up to the function scope. - Local to the current script file. - Imported functions, see `:import`. -In all cases the function must be defined before used. To make a call cycle a -global function needs to be used. (TODO: can we fix this?) +In all cases the function must be defined before used. That is when it is +first called or when `:defcompile` causes the call to be compiled. The result is that functions and variables without a namespace can always be found in the script, either defined there or imported. Global functions and @@ -127,57 +132,7 @@ variables could be defined anywhere (goo Global functions can be 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. - - -Four phases when loading a Vim9 script ~ - -In legacy script the functions are created when encountered, but parsed only -when used. This allows for defining functions in any order and having them -call each other, so long as the function is defined when it is called: > - func One() - call Two() - endfunc - func Two() - if cond - call One() " recursive call - endif - endfunc - call One() - -In Vim9 script the functions are compiled. When using the same functions as -the above example it is not possible to compile function One without knowing -that function Two exists. Or this would require a runtime check, which is slow -and does not allow for compile time type checking. - -When sourcing a Vim9 script this happens in four phases: -1. Cleanup: If the script was sourced before all script-local variables, - imports and functions are deleted. -2. Discovery: The script is read and declarations of functions, imports and - variables are recognized and the type is parsed. Variable initializers - that are a constant are evaluated, this can also give the type of the - variable. -3. Compilation: Functions are compiled. The script-local functions, imports - and variables from the discovery phase are found and types are checked. -4. Execution: the commands in the script are executed, top to bottom. - Functions are skipped over, they do do not need to be processed again. - Variable initializers are evaluated when encountered. Note that if a - function called earlier has set the value this will be over-written. It is - best to declare variables before where they are used to avoid confusion. - -The result is that items defined at the script level can be used anywhere in -the script. This allows for putting the main function at the top: > - def Main() - SubOne() - SubTwo() - enddef - def SubOne() - ... - def SubTwo() - ... - -Note that script-local variables should either have a type defined or have a -constant initializer. Otherwise an error is given for the type being unknown. +and cannot be deleted or replaced. Variable declarations with :let and :const ~ @@ -212,8 +167,8 @@ The declaration must be done earlier: > endif echo inner -To intentionally use a variable that won't be available later, a block can be -used: > +To intentionally avoid a variable being available later, a block can be used: +> { let temp = 'temp' ... @@ -437,7 +392,9 @@ THIS IS STILL UNDER DEVELOPMENT - ANYTHI `:def`, but it is not possible to nest `:def` inside `:function`, for backwards compatibility. - [!] is used as with `:function`. + [!] is used as with `:function`. Note that in Vim9 + script script-local functions cannot be deleted or + redefined. *:enddef* :enddef End of a function defined with `:def`. @@ -448,6 +405,10 @@ variables can be accessed without the "s before the function. If the script the function is defined in is legacy script, then script-local variables must be accessed with the "s:" prefix. + *:defc* *:defcompile* +:defc[ompile] Compile functions defined in the current script that + were not compiled yet. + This will report errors found during the compilation. *:disa* *:disassemble* :disa[ssemble] {func} Show the instructions generated for {func}. diff --git a/runtime/ftplugin/vim.vim b/runtime/ftplugin/vim.vim --- a/runtime/ftplugin/vim.vim +++ b/runtime/ftplugin/vim.vim @@ -1,7 +1,7 @@ " Vim filetype plugin " Language: Vim " Maintainer: Bram Moolenaar -" Last Change: 2018 Aug 07 +" Last Change: 2020 May 17 " Only do this when not done yet for this buffer if exists("b:did_ftplugin") @@ -12,7 +12,7 @@ endif let b:did_ftplugin = 1 let s:cpo_save = &cpo -set cpo-=C +set cpo&vim if !exists('*VimFtpluginUndo') func VimFtpluginUndo() @@ -63,14 +63,14 @@ if !exists("no_plugin_maps") && !exists( let b:did_add_maps = 1 " Move around functions. - nnoremap [[ m':call search('^\s*fu\%[nction]\>', "bW") - vnoremap [[ m':exe "normal! gv"call search('^\s*fu\%[nction]\>', "bW") - nnoremap ]] m':call search('^\s*fu\%[nction]\>', "W") - vnoremap ]] m':exe "normal! gv"call search('^\s*fu\%[nction]\>', "W") - nnoremap [] m':call search('^\s*endf\%[unction]\>', "bW") - vnoremap [] m':exe "normal! gv"call search('^\s*endf\%[unction]\>', "bW") - nnoremap ][ m':call search('^\s*endf\%[unction]\>', "W") - vnoremap ][ m':exe "normal! gv"call search('^\s*endf\%[unction]\>', "W") + nnoremap [[ m':call search('^\s*\(fu\%[nction]\\|def\)\>', "bW") + vnoremap [[ m':exe "normal! gv"call search('^\s*\(fu\%[nction]\\|def\)\>', "bW") + nnoremap ]] m':call search('^\s*\(fu\%[nction]\\|def\)\>', "W") + vnoremap ]] m':exe "normal! gv"call search('^\s*\(fu\%[nction]\\|def\)\>', "W") + nnoremap [] m':call search('^\s*end\(f\%[unction]\\|def\)\>', "bW") + vnoremap [] m':exe "normal! gv"call search('^\s*end\(f\%[unction]\\|def\)\>', "bW") + nnoremap ][ m':call search('^\s*end\(f\%[unction]\\|def\)\>', "W") + vnoremap ][ m':exe "normal! gv"call search('^\s*end\(f\%[unction]\\|def\)\>', "W") " Move around comments nnoremap ]" :call search('^\(\s*".*\n\)\@ diff --git a/runtime/indent/sshconfig.vim b/runtime/indent/sshconfig.vim new file mode 100644 --- /dev/null +++ b/runtime/indent/sshconfig.vim @@ -0,0 +1,34 @@ +" Vim indent file +" Language: ssh config file +" Maintainer: JasonKim +" Last Change: 2020 May 16 + +if exists("b:did_indent") + finish +endif +let b:did_indent = 1 + +setlocal autoindent +setlocal indentexpr=GetSshconfigIndent(v:lnum) +setlocal indentkeys=o,O,*,0=~host\ ,0=~match\ ,0#,!^F + +let b:undo_indent = "setlocal autoindent< indentexpr< indentkeys<" + +if exists("*GetSshconfigIndent") + finish +endif + +function GetSshconfigIndent(lnum) + let sw = shiftwidth() + let prev_lnum = prevnonblank(a:lnum - 1) + let curr_lnum = a:lnum + let prev_line = getline(prev_lnum) + let curr_line = getline(curr_lnum) + if curr_line =~? '^\s*\(host\|match\)\s' + return 0 + elseif prev_line =~? '^\s*\(host\|match\)\s' + return sw + else + return indent(prev_lnum) + endif +endfunction diff --git a/runtime/indent/testdir/sshconfig.in b/runtime/indent/testdir/sshconfig.in new file mode 100644 --- /dev/null +++ b/runtime/indent/testdir/sshconfig.in @@ -0,0 +1,53 @@ +# vim: set filetype=sshconfig shiftwidth=4 expandtab : + +# START_INDENT +Host myhost +User myuser +PasswordAuthentication no +# END_INDENT + +# START_INDENT +Host aaa +User bbb +Host ccc +Host ddd +# END_INDENT + +# START_INDENT +host aaa +HOST bbb +hoSt ccc +match ddd +MATCH eee +MatCH fff +# END_INDENT + +# START_INDENT +Host aaa +User host +PasswordAuthentication no +Host * +User user +PasswordAuthentication no +Host match +User bbb +# END_INDENT + +# START_INDENT +Host tab +User myuser +# END_INDENT + +# START_INDENT +Host mix +User myuser +# END_INDENT + +# START_INDENT +Host aaa +User bbb +Match ccc +User ddd +HostKeyAlgorithms ssh-ed25519 +Match eee +# END_INDENT diff --git a/runtime/indent/testdir/sshconfig.ok b/runtime/indent/testdir/sshconfig.ok new file mode 100644 --- /dev/null +++ b/runtime/indent/testdir/sshconfig.ok @@ -0,0 +1,53 @@ +# vim: set filetype=sshconfig shiftwidth=4 expandtab : + +# START_INDENT +Host myhost + User myuser + PasswordAuthentication no +# END_INDENT + +# START_INDENT +Host aaa + User bbb +Host ccc +Host ddd +# END_INDENT + +# START_INDENT +host aaa +HOST bbb +hoSt ccc +match ddd +MATCH eee +MatCH fff +# END_INDENT + +# START_INDENT +Host aaa + User host + PasswordAuthentication no +Host * + User user + PasswordAuthentication no +Host match + User bbb +# END_INDENT + +# START_INDENT +Host tab + User myuser +# END_INDENT + +# START_INDENT +Host mix + User myuser +# END_INDENT + +# START_INDENT +Host aaa + User bbb +Match ccc + User ddd + HostKeyAlgorithms ssh-ed25519 +Match eee +# END_INDENT diff --git a/runtime/indent/tex.vim b/runtime/indent/tex.vim --- a/runtime/indent/tex.vim +++ b/runtime/indent/tex.vim @@ -64,14 +64,17 @@ " style) is supported. Thanks Miles Wheeler for reporting. " 2018/02/07 by Yichao Zhou " (*) Make indentation more smart in the normal mode +" 2020/04/26 by Yichao Zhou +" (*) Fix a bug related to \[ & \]. Thanks Manuel Boni for +" reporting. " " }}} " Document: {{{ " -" To set the following options (ok, currently it's just one), add a line like -" let g:tex_indent_items = 1 -" to your ~/.vimrc. +" For proper latex experience, please put +" let g:tex_flavor = "latex" +" into your vimrc. " " * g:tex_indent_brace " @@ -184,13 +187,18 @@ function! GetTeXIndent() " {{{ let line = substitute(getline(lnum), '\s*%.*', '','g') " last line let cline = substitute(getline(v:lnum), '\s*%.*', '', 'g') " current line + let ccol = 1 + while cline[ccol] =~ '\s' + let ccol += 1 + endwhile + " We are in verbatim, so do what our user what. - if synIDattr(synID(v:lnum, indent(v:lnum), 1), "name") == "texZone" + if synIDattr(synID(v:lnum, ccol, 1), "name") == "texZone" if empty(cline) return indent(lnum) else return indent(v:lnum) - end + endif endif if lnum == 0 @@ -253,13 +261,13 @@ function! GetTeXIndent() " {{{ let stay = 0 endif - if cline =~ '^\s*\\\?[\]}]' && s:CheckPairedIsLastCharacter(v:lnum, indent(v:lnum)) + if cline =~ '^\s*\\\?[\]}]' && s:CheckPairedIsLastCharacter(v:lnum, ccol) let ind -= shiftwidth() let stay = 0 endif if line !~ '^\s*\\\?[\]}]' - for i in range(indent(lnum)+1, strlen(line)-1) + for i in range(1, strlen(line)-1) let char = line[i] if char == ']' || char == '}' if s:CheckPairedIsLastCharacter(lnum, i) diff --git a/runtime/macros/less.vim b/runtime/macros/less.vim --- a/runtime/macros/less.vim +++ b/runtime/macros/less.vim @@ -1,6 +1,6 @@ " Vim script to work like "less" " Maintainer: Bram Moolenaar -" Last Change: 2017 Mar 31 +" Last Change: 2020 May 18 " Avoid loading this file twice, allow the user to define his own script. if exists("loaded_less") @@ -66,8 +66,8 @@ endif " When reading from stdin don't consider the file modified. au VimEnter * set nomod -" Can't modify the text -set noma +" Can't modify the text or write the file. +set nomodifiable readonly " Give help noremap h :call Help() diff --git a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim --- a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim +++ b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim @@ -2,7 +2,7 @@ " " Author: Bram Moolenaar " Copyright: Vim license applies, see ":help license" -" Last Change: 2020 Feb 19 +" Last Change: 2020 May 22 " " WORK IN PROGRESS - Only the basics work " Note: On MS-Windows you need a recent version of gdb. The one included with @@ -657,8 +657,10 @@ func s:InstallCommands() command Source call s:GotoSourcewinOrCreateIt() command Winbar call s:InstallWinbar() - " TODO: can the K mapping be restored? - nnoremap K :Evaluate + if !exists('g:termdebug_map_K') || g:termdebug_map_K + let s:k_map_saved = maparg('K', 'n', 0, 1) + nnoremap K :Evaluate + endif if has('menu') && &mouse != '' call s:InstallWinbar() @@ -708,7 +710,10 @@ func s:DeleteCommands() delcommand Source delcommand Winbar - nunmap K + if exists('s:k_map_saved') + call mapset('n', 0, s:k_map_saved) + unlet s:k_map_saved + endif if has('menu') " Remove the WinBar entries from all windows where it was added. diff --git a/runtime/syntax/groovy.vim b/runtime/syntax/groovy.vim --- a/runtime/syntax/groovy.vim +++ b/runtime/syntax/groovy.vim @@ -1,10 +1,10 @@ " Vim syntax file " Language: Groovy -" Original Author: Alessio Pace -" Maintainer: Tobias Rapp -" Version: 0.1.16 +" Original Author: Alessio Pace +" Maintainer: Tobias Rapp +" Version: 0.1.17 " URL: http://www.vim.org/scripts/script.php?script_id=945 -" Last Change: 2016 May 23 +" Last Change: 2020 May 26 " THE ORIGINAL AUTHOR'S NOTES: " @@ -253,7 +253,7 @@ if exists("groovy_regex_strings") endif " syn region groovyELExpr start=+${+ end=+}+ keepend contained syn match groovyELExpr /\${.\{-}}/ contained -syn match groovyELExpr /\$[a-zA-Z_][a-zA-Z0-9_.]*/ contained +syn match groovyELExpr /\$[a-zA-Z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\uFFFE_][a-zA-Z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\uFFFE0-9_.]*/ contained hi def link groovyELExpr Identifier " TODO: better matching. I am waiting to understand how it really works in groovy diff --git a/runtime/syntax/javascript.vim b/runtime/syntax/javascript.vim --- a/runtime/syntax/javascript.vim +++ b/runtime/syntax/javascript.vim @@ -7,7 +7,7 @@ " (ss) repaired several quoting and grouping glitches " (ss) fixed regex parsing issue with multiple qualifiers [gi] " (ss) additional factoring of keywords, globals, and members -" Last Change: 2019 Sep 27 +" Last Change: 2020 May 14 " 2013 Jun 12: adjusted javaScriptRegexpString (Kevin Locke) " 2018 Apr 14: adjusted javaScriptRegexpString (LongJohnCoder) @@ -77,10 +77,10 @@ else syn match javaScriptParens "[()]" endif -syn sync fromstart -syn sync maxlines=100 +if main_syntax == "javascript" + syn sync fromstart + syn sync maxlines=100 -if main_syntax == "javascript" syn sync ccomment javaScriptComment endif diff --git a/runtime/syntax/spec.vim b/runtime/syntax/spec.vim --- a/runtime/syntax/spec.vim +++ b/runtime/syntax/spec.vim @@ -3,7 +3,7 @@ " Language: SPEC: Build/install scripts for Linux RPM packages " Maintainer: Igor Gnatenko i.gnatenko.brain@gmail.com " Former Maintainer: Donovan Rebbechi elflord@panix.com (until March 2014) -" Last Change: 2020 Feb 07 +" Last Change: 2020 May 25 " quit when a syntax file was already loaded if exists("b:current_syntax") @@ -128,6 +128,8 @@ syn case match "sh-like comment stile, only valid in script part syn match shComment contained '#.*$' +syn region dnlComment matchgroup=specComment start=+%dnl+ end=+$+ + syn region shQuote1 contained matchgroup=shQuoteDelim start=+'+ skip=+\\'+ end=+'+ contains=specMacroIdentifier syn region shQuote2 contained matchgroup=shQuoteDelim start=+"+ skip=+\\"+ end=+"+ contains=specVariables,specMacroIdentifier @@ -173,6 +175,7 @@ endif "sh colors hi def link shComment Comment +hi def link dnlComment Comment hi def link shIf Statement hi def link shOperator Special hi def link shQuote1 String diff --git a/runtime/syntax/tex.vim b/runtime/syntax/tex.vim --- a/runtime/syntax/tex.vim +++ b/runtime/syntax/tex.vim @@ -1,8 +1,8 @@ " Vim syntax file " Language: TeX " Maintainer: Charles E. Campbell -" Last Change: Jan 24, 2020 -" Version: 116 +" Last Change: May 19, 2020 +" Version: 117 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_TEX " " Notes: {{{1 @@ -1057,6 +1057,7 @@ if has("conceal") && &enc == 'utf-8' call s:SuperSub('texSuperscript','\^','R','ᴿ') call s:SuperSub('texSuperscript','\^','T','ᵀ') call s:SuperSub('texSuperscript','\^','U','ᵁ') + call s:SuperSub('texSuperscript','\^','V','ⱽ') call s:SuperSub('texSuperscript','\^','W','ᵂ') call s:SuperSub('texSuperscript','\^',',','︐') call s:SuperSub('texSuperscript','\^',':','︓') diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -1,8 +1,8 @@ " Vim syntax file " Language: Vim 8.0 script -" Maintainer: Charles E. Campbell -" Last Change: Apr 15, 2020 -" Version: 8.0-33 +" Maintainer: Charles E. Campbell +" Last Change: May 26, 2020 +" Version: 8.0-35 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_VIM " Automatically generated keyword lists: {{{1 @@ -228,7 +228,7 @@ syn cluster vimOperGroup contains=vimEnv syn match vimOper "\%#=1\(==\|!=\|>=\|<=\|=\~\|!\~\|>\|<\|=\)[?#]\{0,2}" skipwhite nextgroup=vimString,vimSpecFile syn match vimOper "\(\" skipwhite nextgroup=vimString,vimSpecFile syn match vimOper "||\|&&\|[-+.!]" skipwhite nextgroup=vimString,vimSpecFile -syn region vimOperParen matchgroup=vimParenSep start="(" end=")" contains=@vimOperGroup +syn region vimOperParen matchgroup=vimParenSep start="(" end=")" contains=vimoperStar,@vimOperGroup syn region vimOperParen matchgroup=vimSep start="{" end="}" contains=@vimOperGroup nextgroup=vimVar,vimFuncVar if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_noopererror") syn match vimOperError ")" @@ -300,7 +300,7 @@ syn match vimComment excludenl +\s#[^{]. syn match vimComment +\!\\@]'+lc=1 end=+'+ syn region vimString oneline start=+=!+lc=1 skip=+\\\\\|\\!+ end=+!+ contains=@vimStringGroup syn region vimString oneline start="=+"lc=1 skip="\\\\\|\\+" end="+" contains=@vimStringGroup -syn region vimString oneline start="\s/\s*\A"lc=1 skip="\\\\\|\\+" end="/" contains=@vimStringGroup +"syn region vimString oneline start="\s/\s*\A"lc=1 skip="\\\\\|\\+" end="/" contains=@vimStringGroup syn match vimString contained +"[^"]*\\$+ skipnl nextgroup=vimStringCont syn match vimStringCont contained +\(\\\\\|.\)\{-}[^\\]"+ @@ -932,6 +932,7 @@ if !exists("skip_vim_syntax_inits") hi def link vimNumber Number hi def link vimOperError Error hi def link vimOper Operator + hi def link vimOperStar vimOper hi def link vimOption PreProc hi def link vimParenSep Delimiter hi def link vimPatSepErr vimError