Skip to content

Commit 60e6568

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents 056df96 + 7b130b9 commit 60e6568

84 files changed

Lines changed: 19056 additions & 3055 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

runtime/autoload/tar.vim

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ fun! tar#Browse(tarfile)
163163
" call Decho("1: exe silent r! gzip -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - ")
164164
exe "sil! r! gzip -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - "
165165

166-
elseif tarfile =~# '\.\(tgz\)$' || tarfile =~# '\.\(tbz\)$' || tarfile =~# '\.\(txz\)$'
166+
elseif tarfile =~# '\.\(tgz\)$' || tarfile =~# '\.\(tbz\)$' || tarfile =~# '\.\(txz\)$' || tarfile =~# '\.\(tzs\)$'
167167
if has("unix") && executable("file")
168168
let filekind= system("file ".shellescape(tarfile,1)) =~ "bzip2"
169169
else
@@ -174,6 +174,8 @@ fun! tar#Browse(tarfile)
174174
exe "sil! r! bzip2 -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - "
175175
elseif filekind =~ "XZ"
176176
exe "sil! r! xz -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - "
177+
elseif filekind =~ "Zstandard"
178+
exe "sil! r! zstd --decompress --stdout -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - "
177179
else
178180
exe "sil! r! gzip -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - "
179181
endif
@@ -190,6 +192,8 @@ fun! tar#Browse(tarfile)
190192
elseif tarfile =~# '\.\(xz\|txz\)$'
191193
" call Decho("3: exe silent r! xz --decompress --stdout -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - ")
192194
exe "sil! r! xz --decompress --stdout -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - "
195+
elseif tarfile =~# '\.\(zst\|tzs\)$'
196+
exe "sil! r! zstd --decompress --stdout -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - "
193197
else
194198
if tarfile =~ '^\s*-'
195199
" A file name starting with a dash is taken as an option. Prepend ./ to avoid that.
@@ -302,6 +306,9 @@ fun! tar#Read(fname,mode)
302306
elseif fname =~ '\.xz$' && executable("xzcat")
303307
let decmp= "|xzcat"
304308
let doro = 1
309+
elseif fname =~ '\.zst$' && executable("zstdcat")
310+
let decmp= "|zstdcat"
311+
let doro = 1
305312
else
306313
let decmp=""
307314
let doro = 0
@@ -331,6 +338,8 @@ fun! tar#Read(fname,mode)
331338
exe "sil! r! bzip2 -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp
332339
elseif filekind =~ "XZ"
333340
exe "sil! r! xz -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp
341+
elseif filekind =~ "Zstandard"
342+
exe "sil! r! zstd --decompress --stdout -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp
334343
else
335344
exe "sil! r! gzip -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp
336345
endif
@@ -452,6 +461,10 @@ fun! tar#Write(fname)
452461
let tarfile = substitute(tarfile,'\.xz','','e')
453462
let compress= "xz -- ".shellescape(tarfile,0)
454463
" call Decho("compress<".compress.">")
464+
elseif tarfile =~# '\.zst'
465+
call system("zstd --decompress -- ".shellescape(tarfile,0))
466+
let tarfile = substitute(tarfile,'\.zst','','e')
467+
let compress= "zstd -- ".shellescape(tarfile,0)
455468
elseif tarfile =~# '\.lzma'
456469
call system("lzma -d -- ".shellescape(tarfile,0))
457470
let tarfile = substitute(tarfile,'\.lzma','','e')
@@ -676,6 +689,28 @@ fun! tar#Extract()
676689
else
677690
echo "***note*** successfully extracted ".fname
678691
endif
692+
693+
elseif filereadable(tarbase.".tzs")
694+
let extractcmd= substitute(extractcmd,"-","--zstd","")
695+
" call Decho("system(".extractcmd." ".shellescape(tarbase).".tzs ".shellescape(fname).")")
696+
call system(extractcmd." ".shellescape(tarbase).".txz ".shellescape(fname))
697+
if v:shell_error != 0
698+
echohl Error | echo "***error*** ".extractcmd." ".tarbase.".tzs ".fname.": failed!" | echohl NONE
699+
" call Decho("***error*** ".extractcmd." ".tarbase.".tzs ".fname.": failed!")
700+
else
701+
echo "***note*** successfully extracted ".fname
702+
endif
703+
704+
elseif filereadable(tarbase.".tar.zst")
705+
let extractcmd= substitute(extractcmd,"-","--zstd","")
706+
" call Decho("system(".extractcmd." ".shellescape(tarbase).".tar.zst ".shellescape(fname).")")
707+
call system(extractcmd." ".shellescape(tarbase).".tar.xz ".shellescape(fname))
708+
if v:shell_error != 0
709+
echohl Error | echo "***error*** ".extractcmd." ".tarbase.".tar.zst ".fname.": failed!" | echohl NONE
710+
" call Decho("***error*** ".extractcmd." ".tarbase.".tar.zst ".fname.": failed!")
711+
else
712+
echo "***note*** successfully extracted ".fname
713+
endif
679714
endif
680715

681716
" restore option

runtime/compiler/zsh.vim

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
" Vim compiler file
2+
" Compiler: Zsh
3+
" Maintainer: Doug Kearns <[email protected]>
4+
" Last Change: 2020 Sep 6
5+
6+
if exists("current_compiler")
7+
finish
8+
endif
9+
let current_compiler = "zsh"
10+
11+
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
12+
command -nargs=* CompilerSet setlocal <args>
13+
endif
14+
15+
let s:cpo_save = &cpo
16+
set cpo&vim
17+
18+
CompilerSet makeprg=zsh\ -n\ --\ %:S
19+
CompilerSet errorformat=%f:\ line\ %l:\ %m,
20+
\%-G%.%#
21+
22+
let &cpo = s:cpo_save
23+
unlet s:cpo_save

runtime/doc/autocmd.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,6 +1221,7 @@ VimLeave Before exiting Vim, just after writing the
12211221
To detect an abnormal exit use |v:dying|.
12221222
When v:dying is 2 or more this event is not
12231223
triggered.
1224+
To get the exit code use |v:exiting|.
12241225
*VimLeavePre*
12251226
VimLeavePre Before exiting Vim, just before writing the
12261227
.viminfo file. This is executed only once,
@@ -1231,6 +1232,7 @@ VimLeavePre Before exiting Vim, just before writing the
12311232
< To detect an abnormal exit use |v:dying|.
12321233
When v:dying is 2 or more this event is not
12331234
triggered.
1235+
To get the exit code use |v:exiting|.
12341236
*VimResized*
12351237
VimResized After the Vim window was resized, thus 'lines'
12361238
and/or 'columns' changed. Not when starting

runtime/doc/eval.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1850,6 +1850,13 @@ v:dying Normally zero. When a deadly signal is caught it's set to
18501850
< Note: if another deadly signal is caught when v:dying is one,
18511851
VimLeave autocommands will not be executed.
18521852

1853+
*v:exiting* *exiting-variable*
1854+
v:exiting Vim exit code. Normally zero, non-zero when something went
1855+
wrong. The value is v:null before invoking the |VimLeavePre|
1856+
and |VimLeave| autocmds. See |:q|, |:x| and |:cquit|.
1857+
Example: >
1858+
:au VimLeave * echo "Exit value is " .. v:exiting
1859+
<
18531860
*v:echospace* *echospace-variable*
18541861
v:echospace Number of screen cells that can be used for an `:echo` message
18551862
in the last screen line before causing the |hit-enter-prompt|.

runtime/doc/filetype.txt

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -563,16 +563,15 @@ Local mappings:
563563

564564
MAN *ft-man-plugin* *:Man* *man.vim*
565565

566-
Displays a manual page in a nice way. Also see the user manual
567-
|find-manpage|.
568-
569-
To start using the ":Man" command before any manual page was loaded, source
570-
this script from your startup vimrc file: >
566+
This plugin displays a manual page in a nice way. See |find-manpage| in the
567+
user manual for more information.
571568

569+
To start using the |:Man| command before any manual page has been loaded,
570+
source this script from your startup |vimrc| file: >
572571
runtime ftplugin/man.vim
573572
574573
Options:
575-
'iskeyword' the '.' character is added to be able to use CTRL-] on the
574+
'iskeyword' The '.' character is added to support the use of CTRL-] on the
576575
manual page name.
577576

578577
Commands:
@@ -582,24 +581,25 @@ Man {number} {name}
582581

583582
Global mapping:
584583
<Leader>K Displays the manual page for the word under the cursor.
585-
<Plug>ManPreGetPage idem, allows for using a mapping: >
586-
nmap <F1> <Plug>ManPreGetPage<CR>
584+
<Plug>ManPreGetPage
585+
idem, allows for using a mapping: >
586+
nmap <F1> <Plug>ManPreGetPage
587587
588588
Local mappings:
589589
CTRL-] Jump to the manual page for the word under the cursor.
590590
CTRL-T Jump back to the previous manual page.
591-
q Same as ":quit"
591+
q Same as the |:quit| command.
592592

593593
To use a vertical split instead of horizontal: >
594594
let g:ft_man_open_mode = 'vert'
595595
To use a new tab: >
596596
let g:ft_man_open_mode = 'tab'
597597
598-
To enable folding use this: >
599-
let g:ft_man_folding_enable = 1
600-
If you do not like the default folding, use an autocommand to add your desired
598+
To enable |folding|, use this: >
599+
let g:ft_man_folding_enable = 1
600+
If you do not like the default folding, use an |autocommand| to add your desired
601601
folding style instead. For example: >
602-
autocmd FileType man setlocal foldmethod=indent foldenable
602+
autocmd FileType man setlocal foldmethod=indent foldenable
603603
604604
If you would like :Man {number} {name} to behave like man {number} {name} by
605605
not running man {name} if no page is found, then use this: >
@@ -612,7 +612,7 @@ page in a Vim window: >
612612
613613
MANPAGER *manpager.vim*
614614

615-
The :Man command allows you to turn Vim into a manpager (that syntax highlights
615+
The |:Man| command allows you to turn Vim into a manpager (that syntax highlights
616616
manpages and follows linked manpages on hitting CTRL-]).
617617

618618
For bash,zsh,ksh or dash, add to the config file (.bashrc,.zshrc, ...)

runtime/doc/syntax.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*syntax.txt* For Vim version 8.2. Last change: 2020 Aug 15
1+
*syntax.txt* For Vim version 8.2. Last change: 2020 Nov 22
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -5305,6 +5305,12 @@ If you like Question highlighting for C comments, put this in your vimrc file: >
53055305
Without the "default" in the C syntax file, the highlighting would be
53065306
overruled when the syntax file is loaded.
53075307

5308+
To have a link survive `:highlight clear`, which is useful if you have
5309+
highlighting for a specific filetype and you want to keep it when selecting
5310+
another color scheme, put a command like this in the
5311+
"after/syntax/{filetype}.vim" file: >
5312+
highlight! default link cComment Question
5313+
53085314
==============================================================================
53095315
15. Cleaning up *:syn-clear* *E391*
53105316

runtime/doc/terminal.txt

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*terminal.txt* For Vim version 8.2. Last change: 2020 Nov 15
1+
*terminal.txt* For Vim version 8.2. Last change: 2020 Nov 25
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -123,12 +123,14 @@ use |:tlmenu| instead of |:tmenu|.
123123

124124
*options-in-terminal*
125125
After opening the terminal window and setting 'buftype' to "terminal" the
126-
TerminalOpen autocommand event is triggered. This makes it possible to set
127-
options specifically for the window and buffer. Example: >
128-
au TerminalOpen * if &buftype == 'terminal' | setlocal bufhidden=hide | endif
129-
The <abuf> is set to the terminal buffer, but if there is no window (hidden
130-
terminal) then setting options will happen in the wrong buffer, therefore the
131-
check for &buftype in the example.
126+
|TerminalWinOpen| autocommand event is triggered. This makes it possible to set
127+
options specifically for the terminal window and buffer. Example: >
128+
au TerminalWinOpen * setlocal bufhidden=hide
129+
130+
There is also the |TerminalOpen| event, but this may be triggered for a hidden
131+
terminal, and the current window and buffer may not be for the new terminal.
132+
You need to use <abuf>, which is set to the terminal buffer. Example: >
133+
au TerminalOpen * call setbufvar(+expand('<abuf>'), '&colorcolumn', 123)
132134
133135
Mouse events (click and drag) are passed to the terminal. Mouse move events
134136
are only passed when Vim itself is receiving them. For a terminal that is
@@ -504,7 +506,7 @@ term_dumpdiff({filename}, {filename} [, {options}])
504506
+ missing position in first file
505507
- missing position in second file
506508
> cursor position in first file, not in second
507-
< cursor position in secone file, not in first
509+
< cursor position in second file, not in first
508510

509511
Using the "s" key the top and bottom parts are swapped. This
510512
makes it easy to spot a difference.

runtime/doc/todo.txt

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*todo.txt* For Vim version 8.2. Last change: 2020 Nov 19
1+
*todo.txt* For Vim version 8.2. Last change: 2020 Nov 28
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -38,17 +38,17 @@ browser use: https://github.com/vim/vim/issues/1234
3838
*known-bugs*
3939
-------------------- Known bugs and current work -----------------------
4040

41-
Coverity errors in October and November.
42-
4341
Vim9 - Change
4442
- Drop support for #{} early December. Close #7310
4543
-> Does it work to recognize lambda?
4644
{x: int -> x + 5}
4745
var int = 5
4846
{x: int, y: int}
4947
Vim9 - Making everything work:
48+
- Compile: for [key, value] in items(map): Also support @r, $VAR, etc.
5049
- Make map() give an error if the resulting type of the first argument is
51-
wrong. Only works if the type is known?
50+
wrong. Only works if the type is known? Is this slow (need to go over all
51+
items)?
5252
- Run the same tests in :def and Vim9 script, like in Test_expr7_not()
5353
- need to check type when a declaration specifies a type: #6507
5454
let nr: number = 'asdf'
@@ -57,8 +57,6 @@ Vim9 - Making everything work:
5757
the script-local function, not a global one.
5858
- Make sure that where a callback is expected a function can be used (without
5959
quotes). E.g. sort() and map(). Also at the script level.
60-
- assignment to more complex lval: list[1][2][3] = 8 #7309
61-
Also "list[0] += value". test in Test_assign_dict_unknown_type().
6260
- ":put" with ISN_PUT does not handle range correctly, e.g. ":$-2put".
6361
Add command to parse range at runtime?
6462
- When defining an :autocmd or :command, how to specify using Vim9 syntax?
@@ -77,17 +75,13 @@ Vim9 - Making everything work:
7775
- Expand `=expr` in :next, :argedit, :argadd, :argdelete, :drop
7876
- Expand `=expr` in :vimgrep, :vimgrepadd, :lvimgrep, :lvimgrepadd
7977
- Expand `=expr` in :mkspell
80-
- Test that a function defined inside a :def function is local to that
81-
function, g: functions can be defined and script-local functions cannot be
82-
defined.
8378
- Does this work already: can use func as reference:
8479
def SomeFunc() ...
8580
map(list, SomeFunc)
8681
- Support passing v:none to use the default argument value. (#6504)
8782
- make 0 == 'string' fail on the script level, like inside :def.
8883
- Check that when using a user function name without prefix, it does not find
8984
a global function. Prefixing g: is required.
90-
- Compile: for [key, value] in items(map)
9185
- Need the equivalent of get_lval() and set_var_lval() to implement assignment
9286
to nested list and dict members.
9387
- Assignment to dict doesn't work:
@@ -127,8 +121,9 @@ Also:
127121
- Test each level of expressions properly, with type checking
128122
- Test try/catch and throw better, also nested.
129123
Test return inside try/finally jumps to finally and then returns.
130-
- Test: Function declared inside a :def function is local, disappears at the
131-
end of the function. Unless g: is used, just like with variables.
124+
- Test that a function defined inside a :def function is local to that
125+
function, g: functions can be defined and script-local functions cannot be
126+
defined.
132127
- implement :type
133128
- import type declaration?
134129
- Future work: See |vim9-classes|
@@ -160,7 +155,6 @@ Popup windows:
160155
current window.
161156
? - switch between current window and all popup windows
162157
Esc in popup window goes back to previous current window
163-
- Cursor not updated before a redraw, making it jump. (#5943)
164158
- Add a termcap entry for changing the cursor when it goes under the popup and
165159
back. like t_SI and t_EI (t_SU and t_EU, where "U" means under?)
166160
- With terminal in popup, allow for popup_hide() to temporarily hide it.?
@@ -278,6 +272,9 @@ Was originally written by Felipe Morales.
278272

279273
Remove SPACE_IN_FILENAME ? It is only used for completion.
280274

275+
Making breakat support multibyte characters (Yasuhiro Matsumoto, #6598)
276+
Scroll doesn't work correctly, why?
277+
281278
Add 'termguiattr' option, use "gui=" attributes in the terminal? Would work
282279
with 'termguicolors'. #1740
283280

@@ -292,9 +289,6 @@ Add an option to start_timer() to return from the input loop with K_IGNORE.
292289
This is useful e.g. when a popup was created that disables mappings, we need
293290
to return from vgetc() to make this happen. #7011
294291

295-
Making breakat support multibyte characters (Yasuhiro Matsumoto, #6598)
296-
Scroll doesn't work correctly, why?
297-
298292
Expanding <mods> should put the tab number from cmdmod.tab before "tab".
299293
Any way to convert "$" back by using a special value? (#6901)
300294

@@ -323,6 +317,9 @@ autocommands for the buffer lifecycle:
323317
BufIsRenamed (after buffer ID gets another name)
324318
The buffer list and windows are locked, no changes possible
325319

320+
Add a ModeChanged autocommand that has an argument indicating the old and new
321+
mode, as what's returned from mode(). Also used for switching Terminal mode.
322+
326323
Matchparen doesn't remove highlight after undo. (#7054)
327324
Is OK when syntax HL is active.
328325

@@ -766,6 +763,7 @@ Make ":interactive !cmd" stop termcap mode, also when used in an autocommand.
766763

767764
Add buffer argument to undotree(). (#4001)
768765

766+
Memory leak in test_debugger
769767
Using uninitialized value in test_crypt (can't explain why).
770768
Memory leak in test_terminal_fail
771769
TODO: be able to run all parts of test_alot with valgrind separately
@@ -896,9 +894,6 @@ Try out background make plugin:
896894
or asyncmake:
897895
https://github.com/yegappan/asyncmake
898896

899-
Add a ModeChanged autocommand that has an argument indicating the old and new
900-
mode, as what's returned from mode(). Also used for switching Terminal mode.
901-
902897
Add an option with file patterns, to be used when unloading a buffer: If there
903898
is a match, remove entries for the buffer from marks, jumplist, etc. To be
904899
used for git temp files.

runtime/doc/version8.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Timers ~
7676
Also asynchronous are timers. They can fire once or repeatedly and invoke a
7777
function to do any work. For example: >
7878
let tempTimer = timer_start(4000, 'CheckTemp')
79-
This will call the CheckTemp() function four seconds (4000 milli seconds)
79+
This will call the CheckTemp() function four seconds (4000 milliseconds)
8080
later. See |timer_start()|.
8181

8282

0 commit comments

Comments
 (0)