Skip to content

Commit

Permalink
Update runtime files
Browse files Browse the repository at this point in the history
  • Loading branch information
brammool committed Dec 24, 2021
1 parent d3f00f5 commit fa3b723
Show file tree
Hide file tree
Showing 29 changed files with 1,748 additions and 1,285 deletions.
2 changes: 1 addition & 1 deletion runtime/autoload/dist/ft.vim
@@ -1,7 +1,7 @@
" Vim functions for file type detection
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2021 Nov 27
" Last Change: 2021 Dec 17

" These functions are moved here from runtime/filetype.vim to make startup
" faster.
Expand Down
11 changes: 7 additions & 4 deletions runtime/doc/eval.txt
@@ -1,4 +1,4 @@
*eval.txt* For Vim version 8.2. Last change: 2021 Dec 15
*eval.txt* For Vim version 8.2. Last change: 2021 Dec 24


VIM REFERENCE MANUAL by Bram Moolenaar
Expand Down Expand Up @@ -2367,7 +2367,9 @@ v:termresponse The escape sequence returned by the terminal for the |t_RV|
The response from a new xterm is: "<Esc>[> Pp ; Pv ; Pc c". Pp
is the terminal type: 0 for vt100 and 1 for vt220. Pv is the
patch level (since this was introduced in patch 95, it's
always 95 or bigger). Pc is always zero.
always 95 or higher). Pc is always zero.
If Pv is 141 or higher then Vim will try to request terminal
codes. This only works with xterm |xterm-codes|.
{only when compiled with |+termresponse| feature}

*v:termblinkresp*
Expand Down Expand Up @@ -6190,8 +6192,9 @@ getreg([{regname} [, 1 [, {list}]]]) *getreg()*
The result is a String, which is the contents of register
{regname}. Example: >
:let cliptext = getreg('*')
< When {regname} was not set the result is an empty string.
The {regname} argument is a string.
< When register {regname} was not set the result is an empty
string.
The {regname} argument must be a string.

getreg('=') returns the last evaluated value of the expression
register. (For use in maps.)
Expand Down
58 changes: 39 additions & 19 deletions runtime/doc/map.txt
@@ -1,4 +1,4 @@
*map.txt* For Vim version 8.2. Last change: 2021 Dec 15
*map.txt* For Vim version 8.2. Last change: 2021 Dec 20


VIM REFERENCE MANUAL by Bram Moolenaar
Expand Down Expand Up @@ -962,8 +962,7 @@ g@{motion} Call the function set by the 'operatorfunc' option.
"line" {motion} was |linewise|
"char" {motion} was |characterwise|
"block" {motion} was |blockwise-visual|
Although "block" would rarely appear, since it can
only result from Visual mode where "g@" is not useful.
The type can be forced, see |forced-motion|.
{not available when compiled without the |+eval|
feature}

Expand All @@ -974,35 +973,56 @@ Here is an example that counts the number of spaces with <F4>: >
" doubling <F4> works on a line
nnoremap <expr> <F4><F4> CountSpaces() .. '_'
function CountSpaces(virtualedit = '', irregular_block = v:false, type = '') abort
function CountSpaces(context = {}, type = '') abort
if a:type == ''
let &operatorfunc = function('CountSpaces', [&virtualedit, v:false])
let context = #{
\ dot_command: v:false,
\ extend_block: '',
\ virtualedit: [&l:virtualedit, &g:virtualedit],
\ }
let &operatorfunc = function('CountSpaces', [context])
set virtualedit=block
return 'g@'
endif
let cb_save = &clipboard
let sel_save = &selection
let reg_save = getreginfo('"')
let visual_marks_save = [getpos("'<"), getpos("'>")]
let save = #{
\ clipboard: &clipboard,
\ selection: &selection,
\ virtualedit: [&l:virtualedit, &g:virtualedit],
\ register: getreginfo('"'),
\ visual_marks: [getpos("'<"), getpos("'>")],
\ }
try
set clipboard= selection=inclusive virtualedit=
let commands = #{line: "'[V']", char: "`[v`]", block: "`[\<C-V>`]"}->get(a:type, 'v')
if getpos("']")[-1] != 0 || a:irregular_block
let commands ..= 'oO$'
let &operatorfunc = function('CountSpaces', [a:virtualedit, v:true])
let commands = #{
\ line: "'[V']",
\ char: "`[v`]",
\ block: "`[\<C-V>`]",
\ }[a:type]
let [_, _, col, off] = getpos("']")
if off != 0
let vcol = getline("'[")->strpart(0, col + off)->strdisplaywidth()
if vcol >= [line("'["), '$']->virtcol() - 1
let a:context.extend_block = '$'
else
let a:context.extend_block = vcol .. '|'
endif
endif
if a:context.extend_block != ''
let commands ..= 'oO' .. a:context.extend_block
endif
let commands ..= 'y'
execute 'silent noautocmd keepjumps normal! ' .. commands
echomsg getreg('"')->count(' ')
finally
call setreg('"', reg_save)
call setpos("'<", visual_marks_save[0])
call setpos("'>", visual_marks_save[1])
let &clipboard = cb_save
let &selection = sel_save
let &virtualedit = a:virtualedit
call setreg('"', save.register)
call setpos("'<", save.visual_marks[0])
call setpos("'>", save.visual_marks[1])
let &clipboard = save.clipboard
let &selection = save.selection
let [&l:virtualedit, &g:virtualedit] = get(a:context.dot_command ? save : a:context, 'virtualedit')
let a:context.dot_command = v:true
endtry
endfunction
Expand Down
6 changes: 3 additions & 3 deletions runtime/doc/options.txt
@@ -1,4 +1,4 @@
*options.txt* For Vim version 8.2. Last change: 2021 Dec 11
*options.txt* For Vim version 8.2. Last change: 2021 Dec 21


VIM REFERENCE MANUAL by Bram Moolenaar
Expand Down Expand Up @@ -385,7 +385,7 @@ lambda it will be converted to the name, e.g. "<lambda>123". Examples:
set opfunc={a\ ->\ MyOpFunc(a)}
" set using a funcref variable
let Fn = function('MyTagFunc')
let &tagfunc = string(Fn)
let &tagfunc = Fn
" set using a lambda expression
let &tagfunc = {t -> MyTagFunc(t)}
" set using a variable with lambda expression
Expand Down Expand Up @@ -9210,7 +9210,7 @@ A jump table for the options with a short description can be found at |Q_op|.
'xtermcodes' boolean (default on)
global
When detecting xterm patchlevel 141 or higher with the termresponse
mechanism and this option is set, Vim will request the actual termimal
mechanism and this option is set, Vim will request the actual terminal
key codes and number of colors from the terminal. This takes care of
various configuration options of the terminal that cannot be obtained
from the termlib/terminfo entry, see |xterm-codes|.
Expand Down
3 changes: 2 additions & 1 deletion runtime/doc/quickref.txt
@@ -1,4 +1,4 @@
*quickref.txt* For Vim version 8.2. Last change: 2021 Oct 17
*quickref.txt* For Vim version 8.2. Last change: 2021 Dec 21


VIM REFERENCE MANUAL by Bram Moolenaar
Expand Down Expand Up @@ -1010,6 +1010,7 @@ Short explanation of each option: *option-list*
'writeany' 'wa' write to file with no need for "!" override
'writebackup' 'wb' make a backup before overwriting a file
'writedelay' 'wd' delay this many msec for each char (for debug)
'xtermcodes' request terminal codes from an xterm
------------------------------------------------------------------------------
*Q_ur* Undo/Redo commands

Expand Down
2 changes: 1 addition & 1 deletion runtime/doc/syntax.txt
Expand Up @@ -4506,7 +4506,7 @@ it marks the "\(\I\i*\)" sub-expression as external; in the end pattern, it
changes the \z1 back-reference into an external reference referring to the
first external sub-expression in the start pattern. External references can
also be used in skip patterns: >
:syn region foo start="start \(\I\i*\)" skip="not end \z1" end="end \z1"
:syn region foo start="start \z(\I\i*\)" skip="not end \z1" end="end \z1"
Note that normal and external sub-expressions are completely orthogonal and
indexed separately; for instance, if the pattern "\z(..\)\(..\)" is applied
Expand Down
3 changes: 3 additions & 0 deletions runtime/doc/tags
Expand Up @@ -751,6 +751,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
'nowriteany' options.txt /*'nowriteany'*
'nowritebackup' options.txt /*'nowritebackup'*
'nows' options.txt /*'nows'*
'noxtermcodes' options.txt /*'noxtermcodes'*
'nrformats' options.txt /*'nrformats'*
'nu' options.txt /*'nu'*
'number' options.txt /*'number'*
Expand Down Expand Up @@ -1262,6 +1263,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
'writedelay' options.txt /*'writedelay'*
'ws' options.txt /*'ws'*
'ww' options.txt /*'ww'*
'xtermcodes' options.txt /*'xtermcodes'*
'{ motion.txt /*'{*
'} motion.txt /*'}*
( motion.txt /*(*
Expand Down Expand Up @@ -5912,6 +5914,7 @@ collate-variable eval.txt /*collate-variable*
color-xterm syntax.txt /*color-xterm*
coloring syntax.txt /*coloring*
colortest.vim syntax.txt /*colortest.vim*
command-block vim9.txt /*command-block*
command-line-functions usr_41.txt /*command-line-functions*
command-line-window cmdline.txt /*command-line-window*
command-mode intro.txt /*command-mode*
Expand Down
2 changes: 1 addition & 1 deletion runtime/doc/term.txt
@@ -1,4 +1,4 @@
*term.txt* For Vim version 8.2. Last change: 2021 Dec 08
*term.txt* For Vim version 8.2. Last change: 2021 Dec 21


VIM REFERENCE MANUAL by Bram Moolenaar
Expand Down
4 changes: 3 additions & 1 deletion runtime/doc/terminal.txt
@@ -1,4 +1,4 @@
*terminal.txt* For Vim version 8.2. Last change: 2021 Nov 13
*terminal.txt* For Vim version 8.2. Last change: 2021 Dec 21


VIM REFERENCE MANUAL by Bram Moolenaar
Expand Down Expand Up @@ -1428,6 +1428,8 @@ GDB command *termdebug-customizing*
To change the name of the gdb command, set the "g:termdebugger" variable before
invoking `:Termdebug`: >
let g:termdebugger = "mygdb"
If the command needs an argument use a List: >
let g:termdebugger = ['rr', 'replay', '--']
< *gdb-version*
Only debuggers fully compatible with gdb will work. Vim uses the GDB/MI
interface. The "new-ui" command requires gdb version 7.12 or later. if you
Expand Down
22 changes: 13 additions & 9 deletions runtime/doc/todo.txt
@@ -1,4 +1,4 @@
*todo.txt* For Vim version 8.2. Last change: 2021 Dec 15
*todo.txt* For Vim version 8.2. Last change: 2021 Dec 24


VIM REFERENCE MANUAL by Bram Moolenaar
Expand Down Expand Up @@ -38,18 +38,21 @@ browser use: https://github.com/vim/vim/issues/1234
*known-bugs*
-------------------- Known bugs and current work -----------------------

type of v: vars should be more specific
v:completed_item is dict<string>, not dict<any>

E1135 is used twice

"z=" in German can take a very long time, CTRL-C should interrupt it.

Vim9 - Make everything work:
- Check TODO items in vim9execute.c
- use CheckLegacyAndVim9Success(lines) in many more places
- For builtin functions using tv_get_string*() use check_for_string() to be
more strict about the argument type (not a bool).
done: balloon_()
- Check many more builtin function arguments at compile time.
map() could check that the return type of the function argument matches
the type of the list or dict member. (#8092)
Same for other functions, such as searchpair().
- Test try/catch and throw better, also nested.
Test that return inside try/finally jumps to finally and then returns.
- 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.
Expand Down Expand Up @@ -89,6 +92,9 @@ Further Vim9 improvements, possibly after launch:
has(featureName), len(someString)
- Implement as part of an expression: ++expr, --expr, expr++, expr--.

Update list of features to vote on:
- multiple cursors
- built-in LSP support

Popup windows:
- Preview popup not properly updated when it overlaps with completion menu.
Expand Down Expand Up @@ -131,8 +137,6 @@ Text properties:
where property fits in.
Or Should we let the textprop highlight overrule other (e.g. diff) highlight
if the priority is above a certain value? (#7392)
- Popup attached to text property stays visible when text is no longer
visible. (#7736)
- Popup attached to text property stays visible when text is deleted with
"cc". (#7737) "C" works OK. "dd" also files in a buffer with a single
line.
Expand Down Expand Up @@ -249,6 +253,8 @@ Idea: when typing ":e /some/dir/" and "dir" does not exist, highlight in red.
initialization to figure out the default value from 'shell'. Add a test for
this.

Patch to add :argdedupe. (Nir Lichtman, #6235)

MS-Windows: did path modifier :p:8 stop working? #8600

test_arglist func Test_all_not_allowed_from_cmdwin() hangs on MS-Windows.
Expand Down Expand Up @@ -415,8 +421,6 @@ 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?

Patch to add :argdedupe. (Nir Lichtman, #6235)

When editing a file with ":edit" the output of :swapname is relative, while
editing it with "vim file" it is absolute. (#355)
Which one should it be?
Expand Down
19 changes: 11 additions & 8 deletions runtime/doc/various.txt
@@ -1,4 +1,4 @@
*various.txt* For Vim version 8.2. Last change: 2021 Dec 13
*various.txt* For Vim version 8.2. Last change: 2021 Dec 20


VIM REFERENCE MANUAL by Bram Moolenaar
Expand Down Expand Up @@ -549,14 +549,17 @@ N *+X11* Unix only: can restore window title |X11|
name can be omitted.
:redi[r] @">> Append messages to the unnamed register.

:redi[r] => {var} Redirect messages to a variable. If the variable
doesn't exist, then it is created. If the variable
exists, then it is initialized to an empty string.
:redi[r] => {var} Redirect messages to a variable.
In legacy script: If the variable doesn't exist, then
it is created. If the variable exists, then it is
initialized to an empty string. After the redirection
starts, if the variable is removed or locked or the
variable type is changed, then further command output
messages will cause errors.
In Vim9 script: the variable must have been declared
as a string.
The variable will remain empty until redirection ends.
Only string variables can be used. After the
redirection starts, if the variable is removed or
locked or the variable type is changed, then further
command output messages will cause errors.
Only string variables can be used.
To get the output of one command the |execute()|
function can be used instead of redirection.

Expand Down
8 changes: 4 additions & 4 deletions runtime/doc/vim9.txt
@@ -1,4 +1,4 @@
*vim9.txt* For Vim version 8.2. Last change: 2021 Dec 15
*vim9.txt* For Vim version 8.2. Last change: 2021 Dec 22


VIM REFERENCE MANUAL by Bram Moolenaar
Expand Down Expand Up @@ -169,8 +169,8 @@ created yet. In this case you can call `execute()` to invoke it at runtime. >
`: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
cannot be a "dict" function, and can always be a closure.
used for the command or the error was caught a `:try` block), does not get a
range passed cannot be a "dict" function, and can always be a closure.
*vim9-no-dict-function*
Later classes will be added, which replaces the "dict function" mechanism.
For now you will need to pass the dictionary explicitly: >
Expand Down Expand Up @@ -509,7 +509,7 @@ The function must already have been defined. >
When using `function()` the resulting type is "func", a function with any
number of arguments and any return type (including void). The function can be
defined later.
defined later if the argument is in quotes.


Lambda using => instead of -> ~
Expand Down
2 changes: 1 addition & 1 deletion runtime/filetype.vim
@@ -1,7 +1,7 @@
" Vim support file to detect file types
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2021 Dec 14
" Last Change: 2021 Dec 22

" Listen very carefully, I will say this only once
if exists("did_load_filetypes")
Expand Down
8 changes: 4 additions & 4 deletions runtime/ftplugin/zsh.vim
Expand Up @@ -18,13 +18,13 @@ setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql

let b:undo_ftplugin = "setl com< cms< fo< "

if executable('zsh')
if executable('zsh') && &shell !~# '/\%(nologin\|false\)$'
if !has('gui_running') && executable('less')
command! -buffer -nargs=1 RunHelp silent exe '!MANPAGER= zsh -ic "autoload -Uz run-help; run-help <args> 2>/dev/null | LESS= less"' | redraw!
command! -buffer -nargs=1 RunHelp silent exe '!MANPAGER= zsh -c "autoload -Uz run-help; run-help <args> 2>/dev/null | LESS= less"' | redraw!
elseif has('terminal')
command! -buffer -nargs=1 RunHelp silent exe ':term zsh -ic "autoload -Uz run-help; run-help <args>"'
command! -buffer -nargs=1 RunHelp silent exe ':term zsh -c "autoload -Uz run-help; run-help <args>"'
else
command! -buffer -nargs=1 RunHelp echo system('zsh -ic "autoload -Uz run-help; run-help <args> 2>/dev/null"')
command! -buffer -nargs=1 RunHelp echo system('zsh -c "autoload -Uz run-help; run-help <args> 2>/dev/null"')
endif
if !exists('current_compiler')
compiler zsh
Expand Down
2 changes: 1 addition & 1 deletion runtime/indent/sh.vim
Expand Up @@ -109,7 +109,7 @@ function! GetShIndent()
let ind += s:indent_value('continuation-line')
endif
elseif s:end_block(line) && !s:start_block(line)
let ind -= s:indent_value('default')
let ind = indent(lnum)
elseif pnum != 0 &&
\ s:is_continuation_line(pline) &&
\ !s:end_block(curline) &&
Expand Down

0 comments on commit fa3b723

Please sign in to comment.