Update runtime files

This commit is contained in:
Bram Moolenaar
2020-11-21 13:16:30 +01:00
parent 2d718267f4
commit 4466ad6baa
21 changed files with 201 additions and 110 deletions

View File

@ -159,18 +159,18 @@ thing I have been thinking of is assignments without ":let". I often
make that mistake (after writing JavaScript especially). I think it is make that mistake (after writing JavaScript especially). I think it is
possible, if we make local variables shadow commands. That should be OK, possible, if we make local variables shadow commands. That should be OK,
if you shadow a command you want to use, just rename the variable. if you shadow a command you want to use, just rename the variable.
Using "let" and "const" to declare a variable, like in JavaScript and Using "var" and "const" to declare a variable, like in JavaScript and
TypeScript, can work: TypeScript, can work:
``` vim ``` vim
def MyFunction(arg: number): number def MyFunction(arg: number): number
let local = 1 var local = 1
let todo = arg var todo = arg
const ADD = 88 const ADD = 88
while todo > 0 while todo > 0
local += ADD local += ADD
--todo todo -= 1
endwhile endwhile
return local return local
enddef enddef
@ -192,7 +192,7 @@ function and export it:
``` vim ``` vim
vim9script " Vim9 script syntax used here vim9script " Vim9 script syntax used here
let local = 'local variable is not exported, script-local' var local = 'local variable is not exported, script-local'
export def MyFunction() " exported function export def MyFunction() " exported function
... ...
@ -248,10 +248,10 @@ END
return luaeval('sum') return luaeval('sum')
endfunc endfunc
def VimNew() def VimNew(): number
let sum = 0 var sum = 0
for i in range(1, 2999999) for i in range(1, 2999999)
let sum += i sum += i
endfor endfor
return sum return sum
enddef enddef
@ -277,7 +277,7 @@ echo 'Vim new: ' .. reltimestr(reltime(start))
``` vim ``` vim
def VimNew(): number def VimNew(): number
let totallen = 0 var totallen = 0
for i in range(1, 100000) for i in range(1, 100000)
setline(i, ' ' .. getline(i)) setline(i, ' ' .. getline(i))
totallen += len(getline(i)) totallen += len(getline(i))

View File

@ -1,13 +1,13 @@
" Vim completion script " Vim completion script
" Language: C " Language: C
" Maintainer: Bram Moolenaar <Bram@vim.org> " Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2020 Apr 08 " Last Change: 2020 Nov 14
let s:cpo_save = &cpo let s:cpo_save = &cpo
set cpo&vim set cpo&vim
" This function is used for the 'omnifunc' option. " This function is used for the 'omnifunc' option.
function! ccomplete#Complete(findstart, base) func ccomplete#Complete(findstart, base)
if a:findstart if a:findstart
" Locate the start of the item, including ".", "->" and "[...]". " Locate the start of the item, including ".", "->" and "[...]".
let line = getline('.') let line = getline('.')
@ -244,7 +244,7 @@ function! ccomplete#Complete(findstart, base)
return map(res, 's:Tagline2item(v:val, brackets)') return map(res, 's:Tagline2item(v:val, brackets)')
endfunc endfunc
function! s:GetAddition(line, match, memarg, bracket) func s:GetAddition(line, match, memarg, bracket)
" Guess if the item is an array. " Guess if the item is an array.
if a:bracket && match(a:line, a:match . '\s*\[') > 0 if a:bracket && match(a:line, a:match . '\s*\[') > 0
return '[' return '['
@ -260,13 +260,13 @@ function! s:GetAddition(line, match, memarg, bracket)
endif endif
endif endif
return '' return ''
endfunction endfunc
" Turn the tag info "val" into an item for completion. " Turn the tag info "val" into an item for completion.
" "val" is is an item in the list returned by taglist(). " "val" is is an item in the list returned by taglist().
" If it is a variable we may add "." or "->". Don't do it for other types, " If it is a variable we may add "." or "->". Don't do it for other types,
" such as a typedef, by not including the info that s:GetAddition() uses. " such as a typedef, by not including the info that s:GetAddition() uses.
function! s:Tag2item(val) func s:Tag2item(val)
let res = {'match': a:val['name']} let res = {'match': a:val['name']}
let res['extra'] = s:Tagcmd2extra(a:val['cmd'], a:val['name'], a:val['filename']) let res['extra'] = s:Tagcmd2extra(a:val['cmd'], a:val['name'], a:val['filename'])
@ -289,10 +289,10 @@ function! s:Tag2item(val)
endif endif
return res return res
endfunction endfunc
" Use all the items in dictionary for the "info" entry. " Use all the items in dictionary for the "info" entry.
function! s:Dict2info(dict) func s:Dict2info(dict)
let info = '' let info = ''
for k in sort(keys(a:dict)) for k in sort(keys(a:dict))
let info .= k . repeat(' ', 10 - len(k)) let info .= k . repeat(' ', 10 - len(k))
@ -307,7 +307,7 @@ function! s:Dict2info(dict)
endfunc endfunc
" Parse a tag line and return a dictionary with items like taglist() " Parse a tag line and return a dictionary with items like taglist()
function! s:ParseTagline(line) func s:ParseTagline(line)
let l = split(a:line, "\t") let l = split(a:line, "\t")
let d = {} let d = {}
if len(l) >= 3 if len(l) >= 3
@ -334,12 +334,12 @@ function! s:ParseTagline(line)
endif endif
return d return d
endfunction endfunc
" Turn a match item "val" into an item for completion. " Turn a match item "val" into an item for completion.
" "val['match']" is the matching item. " "val['match']" is the matching item.
" "val['tagline']" is the tagline in which the last part was found. " "val['tagline']" is the tagline in which the last part was found.
function! s:Tagline2item(val, brackets) func s:Tagline2item(val, brackets)
let line = a:val['tagline'] let line = a:val['tagline']
let add = s:GetAddition(line, a:val['match'], [a:val], a:brackets == '') let add = s:GetAddition(line, a:val['match'], [a:val], a:brackets == '')
let res = {'word': a:val['match'] . a:brackets . add } let res = {'word': a:val['match'] . a:brackets . add }
@ -377,10 +377,10 @@ function! s:Tagline2item(val, brackets)
let res['menu'] = s:Tagcmd2extra(s, a:val['match'], matchstr(line, '[^\t]*\t\zs[^\t]*\ze\t')) let res['menu'] = s:Tagcmd2extra(s, a:val['match'], matchstr(line, '[^\t]*\t\zs[^\t]*\ze\t'))
endif endif
return res return res
endfunction endfunc
" Turn a command from a tag line to something that is useful in the menu " Turn a command from a tag line to something that is useful in the menu
function! s:Tagcmd2extra(cmd, name, fname) func s:Tagcmd2extra(cmd, name, fname)
if a:cmd =~ '^/^' if a:cmd =~ '^/^'
" The command is a search command, useful to see what it is. " The command is a search command, useful to see what it is.
let x = matchstr(a:cmd, '^/^\s*\zs.*\ze$/') let x = matchstr(a:cmd, '^/^\s*\zs.*\ze$/')
@ -395,13 +395,13 @@ function! s:Tagcmd2extra(cmd, name, fname)
let x = a:cmd . ' - ' . a:fname let x = a:cmd . ' - ' . a:fname
endif endif
return x return x
endfunction endfunc
" Find composing type in "lead" and match items[0] with it. " Find composing type in "lead" and match items[0] with it.
" Repeat this recursively for items[1], if it's there. " Repeat this recursively for items[1], if it's there.
" When resolving typedefs "depth" is used to avoid infinite recursion. " When resolving typedefs "depth" is used to avoid infinite recursion.
" Return the list of matches. " Return the list of matches.
function! s:Nextitem(lead, items, depth, all) func s:Nextitem(lead, items, depth, all)
" Use the text up to the variable name and split it in tokens. " Use the text up to the variable name and split it in tokens.
let tokens = split(a:lead, '\s\+\|\<') let tokens = split(a:lead, '\s\+\|\<')
@ -485,7 +485,7 @@ function! s:Nextitem(lead, items, depth, all)
endfor endfor
return res return res
endfunction endfunc
" Search for members of structure "typename" in tags files. " Search for members of structure "typename" in tags files.
@ -493,7 +493,7 @@ endfunction
" Each match is a dictionary with "match" and "tagline" entries. " Each match is a dictionary with "match" and "tagline" entries.
" When "all" is non-zero find all, otherwise just return 1 if there is any " When "all" is non-zero find all, otherwise just return 1 if there is any
" member. " member.
function! s:StructMembers(typename, items, all) func s:StructMembers(typename, items, all)
" Todo: What about local structures? " Todo: What about local structures?
let fnames = join(map(tagfiles(), 'escape(v:val, " \\#%")')) let fnames = join(map(tagfiles(), 'escape(v:val, " \\#%")'))
if fnames == '' if fnames == ''
@ -586,12 +586,12 @@ function! s:StructMembers(typename, items, all)
" Failed to find anything. " Failed to find anything.
return [] return []
endfunction endfunc
" For matching members, find matches for following items. " For matching members, find matches for following items.
" When "all" is non-zero find all, otherwise just return 1 if there is any " When "all" is non-zero find all, otherwise just return 1 if there is any
" member. " member.
function! s:SearchMembers(matches, items, all) func s:SearchMembers(matches, items, all)
let res = [] let res = []
for i in range(len(a:matches)) for i in range(len(a:matches))
let typename = '' let typename = ''

View File

@ -1,4 +1,4 @@
*autocmd.txt* For Vim version 8.2. Last change: 2020 Oct 26 *autocmd.txt* For Vim version 8.2. Last change: 2020 Nov 12
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -70,6 +70,10 @@ effects. Be careful not to destroy your text.
The special pattern <buffer> or <buffer=N> defines a buffer-local autocommand. The special pattern <buffer> or <buffer=N> defines a buffer-local autocommand.
See |autocmd-buflocal|. See |autocmd-buflocal|.
If the `:autocmd` is in Vim9 script then {cmd} will be executed as in Vim9
script. Thus this depends on where the autocmd is defined, not where it is
triggered.
Note: The ":autocmd" command can only be followed by another command when the Note: The ":autocmd" command can only be followed by another command when the
'|' appears before {cmd}. This works: > '|' appears before {cmd}. This works: >
:augroup mine | au! BufRead | augroup END :augroup mine | au! BufRead | augroup END

View File

@ -1,4 +1,4 @@
*change.txt* For Vim version 8.2. Last change: 2020 Nov 03 *change.txt* For Vim version 8.2. Last change: 2020 Nov 21
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -1852,6 +1852,8 @@ found here: |sort()|, |uniq()|.
When /{pattern}/ is specified and there is no [r] flag When /{pattern}/ is specified and there is no [r] flag
the text matched with {pattern} is skipped, so that the text matched with {pattern} is skipped, so that
you sort on what comes after the match. you sort on what comes after the match.
'ignorecase' applies to the pattern, but 'smartcase'
is not used.
Instead of the slash any non-letter can be used. Instead of the slash any non-letter can be used.
For example, to sort on the second comma-separated For example, to sort on the second comma-separated
field: > field: >

View File

@ -1,4 +1,4 @@
*eval.txt* For Vim version 8.2. Last change: 2020 Nov 04 *eval.txt* For Vim version 8.2. Last change: 2020 Nov 11
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -3473,8 +3473,8 @@ byteidx({expr}, {nr}) *byteidx()*
Return byte index of the {nr}'th character in the string Return byte index of the {nr}'th character in the string
{expr}. Use zero for the first character, it then returns {expr}. Use zero for the first character, it then returns
zero. zero.
This function is only useful when there are multibyte If there are no multibyte characters the returned value is
characters, otherwise the returned value is equal to {nr}. equal to {nr}.
Composing characters are not counted separately, their byte Composing characters are not counted separately, their byte
length is added to the preceding base character. See length is added to the preceding base character. See
|byteidxcomp()| below for counting composing characters |byteidxcomp()| below for counting composing characters
@ -7433,7 +7433,9 @@ matchfuzzy({list}, {str} [, {dict}]) *matchfuzzy()*
matchfuzzypos({list}, {str} [, {dict}]) *matchfuzzypos()* matchfuzzypos({list}, {str} [, {dict}]) *matchfuzzypos()*
Same as |matchfuzzy()|, but returns the list of matched Same as |matchfuzzy()|, but returns the list of matched
strings and the list of character positions where characters strings and the list of character positions where characters
in {str} matches. in {str} matches. You can use |byteidx()|to convert a
character position to a byte position.
If {str} matches multiple times in a string, then only the If {str} matches multiple times in a string, then only the
positions for the best match is returned. positions for the best match is returned.
@ -8728,11 +8730,16 @@ search({pattern} [, {flags} [, {stopline} [, {timeout} [, {skip}]]]])
'ignorecase', 'smartcase' and 'magic' are used. 'ignorecase', 'smartcase' and 'magic' are used.
When the 'z' flag is not given, searching always starts in When the 'z' flag is not given, forward searching always
column zero and then matches before the cursor are skipped. starts in column zero and then matches before the cursor are
When the 'c' flag is present in 'cpo' the next search starts skipped. When the 'c' flag is present in 'cpo' the next
after the match. Without the 'c' flag the next search starts search starts after the match. Without the 'c' flag the next
one column further. search starts one column further. This matters for
overlapping matches.
When searching backwards and the 'z' flag is given then the
search starts in column zero, thus no match in the current
line will be found (unless wrapping around the end of the
file).
When the {stopline} argument is given then the search stops When the {stopline} argument is given then the search stops
after searching this line. This is useful to restrict the after searching this line. This is useful to restrict the

View File

@ -1,4 +1,4 @@
*map.txt* For Vim version 8.2. Last change: 2020 Nov 12 *map.txt* For Vim version 8.2. Last change: 2020 Nov 21
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -319,13 +319,16 @@ Example of using <Cmd> halfway Insert mode: >
nnoremap <F3> aText <Cmd>echo mode(1)<CR> Added<Esc> nnoremap <F3> aText <Cmd>echo mode(1)<CR> Added<Esc>
Unlike <expr> mappings, there are no special restrictions on the <Cmd> Unlike <expr> mappings, there are no special restrictions on the <Cmd>
command: it is executed as if an (unrestricted) |autocmd| was invoked. command: it is executed as if an (unrestricted) |autocommand| was invoked.
Note: Note:
- Because <Cmd> avoids mode-changes it does not trigger |CmdlineEnter| and - Because <Cmd> avoids mode-changes it does not trigger |CmdlineEnter| and
|CmdlineLeave| events, because no user interaction is expected. |CmdlineLeave| events, because no user interaction is expected.
- For the same reason, |keycodes| like <C-R><C-W> are interpreted as plain, - For the same reason, |keycodes| like <C-R><C-W> are interpreted as plain,
unmapped keys. unmapped keys.
- The command is not echo'ed, no need for <silent>.
- In Visual mode you can use `line('v')` and `col('v')` to get one end of the
Visual area, the cursor is at the other end.
- In Select mode, |:map| and |:vmap| command mappings are executed in - In Select mode, |:map| and |:vmap| command mappings are executed in
Visual mode. Use |:smap| to handle Select mode differently. Visual mode. Use |:smap| to handle Select mode differently.
@ -1238,9 +1241,9 @@ Otherwise, using "<SID>" outside of a script context is an error.
If you need to get the script number to use in a complicated script, you can If you need to get the script number to use in a complicated script, you can
use this function: > use this function: >
function s:SID() func s:ScriptNumber()
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze_SID$') return matchstr(expand('<SID>'), '<SNR>\zs\d\+\ze_')
endfun endfunc
The "<SNR>" will be shown when listing functions and mappings. This is useful The "<SNR>" will be shown when listing functions and mappings. This is useful
to find out what they are defined to. to find out what they are defined to.

View File

@ -1,4 +1,4 @@
*popup.txt* For Vim version 8.2. Last change: 2020 Oct 17 *popup.txt* For Vim version 8.2. Last change: 2020 Nov 07
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -101,7 +101,7 @@ CLOSING THE POPUP WINDOW *popup-close*
Normally the plugin that created the popup window is also in charge of closing Normally the plugin that created the popup window is also in charge of closing
it. If somehow a popup hangs around, you can close all of them with: > it. If somehow a popup hangs around, you can close all of them with: >
call popup_clear() call popup_clear(1)
Some popups, such as notifications, close after a specified time. This can be Some popups, such as notifications, close after a specified time. This can be
set with the "time" property on `popup_create()`. set with the "time" property on `popup_create()`.
Otherwise, a popup can be closed by clicking on the X in the top-right corner Otherwise, a popup can be closed by clicking on the X in the top-right corner

View File

@ -3006,7 +3006,7 @@ vimrc file: >
(Adapted from the html.vim help text by Claudio Fleiner <claudio@fleiner.com>) (Adapted from the html.vim help text by Claudio Fleiner <claudio@fleiner.com>)
*ft-posix-synax* *ft-dash-syntax* *ft-posix-syntax* *ft-dash-syntax*
SH *sh.vim* *ft-sh-syntax* *ft-bash-syntax* *ft-ksh-syntax* SH *sh.vim* *ft-sh-syntax* *ft-bash-syntax* *ft-ksh-syntax*
This covers syntax highlighting for the older Unix (Bourne) sh, and newer This covers syntax highlighting for the older Unix (Bourne) sh, and newer

View File

@ -2125,6 +2125,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
:bad windows.txt /*:bad* :bad windows.txt /*:bad*
:badd windows.txt /*:badd* :badd windows.txt /*:badd*
:ball windows.txt /*:ball* :ball windows.txt /*:ball*
:balt windows.txt /*:balt*
:bar cmdline.txt /*:bar* :bar cmdline.txt /*:bar*
:bd windows.txt /*:bd* :bd windows.txt /*:bd*
:bdel windows.txt /*:bdel* :bdel windows.txt /*:bdel*
@ -2724,6 +2725,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
:map-<unique> map.txt /*:map-<unique>* :map-<unique> map.txt /*:map-<unique>*
:map-alt-keys map.txt /*:map-alt-keys* :map-alt-keys map.txt /*:map-alt-keys*
:map-arguments map.txt /*:map-arguments* :map-arguments map.txt /*:map-arguments*
:map-cmd map.txt /*:map-cmd*
:map-commands map.txt /*:map-commands* :map-commands map.txt /*:map-commands*
:map-expression map.txt /*:map-expression* :map-expression map.txt /*:map-expression*
:map-local map.txt /*:map-local* :map-local map.txt /*:map-local*
@ -3506,6 +3508,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
<CSI> intro.txt /*<CSI>* <CSI> intro.txt /*<CSI>*
<Char-> map.txt /*<Char->* <Char-> map.txt /*<Char->*
<Char> map.txt /*<Char>* <Char> map.txt /*<Char>*
<Cmd> map.txt /*<Cmd>*
<CursorHold> autocmd.txt /*<CursorHold>* <CursorHold> autocmd.txt /*<CursorHold>*
<D- intro.txt /*<D-* <D- intro.txt /*<D-*
<D-c> os_mac.txt /*<D-c>* <D-c> os_mac.txt /*<D-c>*
@ -3923,6 +3926,9 @@ E1112 eval.txt /*E1112*
E1113 eval.txt /*E1113* E1113 eval.txt /*E1113*
E112 eval.txt /*E112* E112 eval.txt /*E112*
E113 eval.txt /*E113* E113 eval.txt /*E113*
E1135 map.txt /*E1135*
E1136 map.txt /*E1136*
E1137 map.txt /*E1137*
E114 eval.txt /*E114* E114 eval.txt /*E114*
E115 eval.txt /*E115* E115 eval.txt /*E115*
E116 eval.txt /*E116* E116 eval.txt /*E116*
@ -6549,7 +6555,7 @@ ft-php-syntax syntax.txt /*ft-php-syntax*
ft-php3-syntax syntax.txt /*ft-php3-syntax* ft-php3-syntax syntax.txt /*ft-php3-syntax*
ft-phtml-syntax syntax.txt /*ft-phtml-syntax* ft-phtml-syntax syntax.txt /*ft-phtml-syntax*
ft-plaintex-syntax syntax.txt /*ft-plaintex-syntax* ft-plaintex-syntax syntax.txt /*ft-plaintex-syntax*
ft-posix-synax syntax.txt /*ft-posix-synax* ft-posix-syntax syntax.txt /*ft-posix-syntax*
ft-postscr-syntax syntax.txt /*ft-postscr-syntax* ft-postscr-syntax syntax.txt /*ft-postscr-syntax*
ft-ppwiz-syntax syntax.txt /*ft-ppwiz-syntax* ft-ppwiz-syntax syntax.txt /*ft-ppwiz-syntax*
ft-printcap-syntax syntax.txt /*ft-printcap-syntax* ft-printcap-syntax syntax.txt /*ft-printcap-syntax*
@ -7745,6 +7751,7 @@ mapmode-s map.txt /*mapmode-s*
mapmode-t map.txt /*mapmode-t* mapmode-t map.txt /*mapmode-t*
mapmode-v map.txt /*mapmode-v* mapmode-v map.txt /*mapmode-v*
mapmode-x map.txt /*mapmode-x* mapmode-x map.txt /*mapmode-x*
mapnew() eval.txt /*mapnew()*
mapping map.txt /*mapping* mapping map.txt /*mapping*
mapping-functions usr_41.txt /*mapping-functions* mapping-functions usr_41.txt /*mapping-functions*
mapset() eval.txt /*mapset()* mapset() eval.txt /*mapset()*

View File

@ -1,4 +1,4 @@
*terminal.txt* For Vim version 8.2. Last change: 2020 Sep 04 *terminal.txt* For Vim version 8.2. Last change: 2020 Nov 15
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -503,6 +503,8 @@ term_dumpdiff({filename}, {filename} [, {options}])
a different attribute a different attribute
+ missing position in first file + missing position in first file
- missing position in second file - missing position in second file
> cursor position in first file, not in second
< cursor position in secone file, not in first
Using the "s" key the top and bottom parts are swapped. This Using the "s" key the top and bottom parts are swapped. This
makes it easy to spot a difference. makes it easy to spot a difference.
@ -1411,16 +1413,18 @@ If you don't want this then disable it with: >
Vim window width *termdebug_wide* Vim window width *termdebug_wide*
To change the width of the Vim window when debugging starts, and use a To change the width of the Vim window when debugging starts and use a vertical
vertical split: > split: >
let g:termdebug_wide = 163 let g:termdebug_wide = 163
This will set &columns to 163 when `:Termdebug` is used. The value is restored
when quitting the debugger.
If g:termdebug_wide is set and &columns is already larger than
g:termdebug_wide then a vertical split will be used without changing &columns.
Set it to 1 to get a vertical split without every changing &columns (useful
for when the terminal can't be resized by Vim).
This will set 'columns' to 163 when `:Termdebug` is used. The value is
restored when quitting the debugger.
If g:termdebug_wide is set and 'columns' is already a greater value, then a
vertical split will be used without modifying 'columns'.
Set g:termdebug_wide to 1 to use a vertical split without ever changing
'columns'. This is useful when the terminal can't be resized by Vim.
vim:tw=78:ts=8:noet:ft=help:norl: vim:tw=78:ts=8:noet:ft=help:norl:

View File

@ -1,4 +1,4 @@
*todo.txt* For Vim version 8.2. Last change: 2020 Nov 04 *todo.txt* For Vim version 8.2. Last change: 2020 Nov 19
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -38,21 +38,18 @@ browser use: https://github.com/vim/vim/issues/1234
*known-bugs* *known-bugs*
-------------------- Known bugs and current work ----------------------- -------------------- Known bugs and current work -----------------------
test_vim9_func fails: type from default value not used. Coverity errors in October and November.
Without extra sleeps netbeans test has valgrind errors. Vim9 - Change
PR #7248 from Yegappan - test doesn't fail without code changes - Drop support for #{} early December. Close #7310
-> Does it work to recognize lambda?
Making everything work: {x: int -> x + 5}
- Closure argument call should not always set varargs, like any function call? var int = 5
- Invoke user command in a :def function {x: int, y: int}
- Make map() give an error if the resulting type is wrong. Vim9 - Making everything work:
Add mapnew() or mapcopy() to create a new List/Dict for the result, which - Make map() give an error if the resulting type of the first argument is
can have a different value type. wrong. Only works if the type is known?
- Error message for "'yes && 0" is "using String as a Number", should be "using
String as a Bool".
- Run the same tests in :def and Vim9 script, like in Test_expr7_not() - Run the same tests in :def and Vim9 script, like in Test_expr7_not()
- In autocmd: use legacy syntax, not whatever the current script uses?
- need to check type when a declaration specifies a type: #6507 - need to check type when a declaration specifies a type: #6507
let nr: number = 'asdf' let nr: number = 'asdf'
- Check many more builtin function arguments at compile time. - Check many more builtin function arguments at compile time.
@ -60,7 +57,7 @@ Making everything work:
the script-local function, not a global one. the script-local function, not a global one.
- Make sure that where a callback is expected a function can be used (without - Make sure that where a callback is expected a function can be used (without
quotes). E.g. sort() and map(). Also at the script level. quotes). E.g. sort() and map(). Also at the script level.
- assignment to more complex lval: list[1][2][3] = 8 - assignment to more complex lval: list[1][2][3] = 8 #7309
Also "list[0] += value". test in Test_assign_dict_unknown_type(). Also "list[0] += value". test in Test_assign_dict_unknown_type().
- ":put" with ISN_PUT does not handle range correctly, e.g. ":$-2put". - ":put" with ISN_PUT does not handle range correctly, e.g. ":$-2put".
Add command to parse range at runtime? Add command to parse range at runtime?
@ -91,11 +88,13 @@ Making everything work:
- Check that when using a user function name without prefix, it does not find - Check that when using a user function name without prefix, it does not find
a global function. Prefixing g: is required. a global function. Prefixing g: is required.
- Compile: for [key, value] in items(map) - Compile: for [key, value] in items(map)
- Assignment to dict doesn't work: - Need the equivalent of get_lval() and set_var_lval() to implement assignment
let ret: dict<string> = #{} to nested list and dict members.
ret[i] = string(i) - Assignment to dict doesn't work:
- Appending to dict item doesn't work: let ret: dict<string> = #{}
let d[i] ..= value ret[i] = string(i)
- Appending to dict item doesn't work:
let d[i] ..= value
- Using ".." at script level doesn't convert arguments to a string. - Using ".." at script level doesn't convert arguments to a string.
- Compile replacement of :s command: s/pat/\=expr/ - Compile replacement of :s command: s/pat/\=expr/
- Compile redir to local variable: var_redir_start(). - Compile redir to local variable: var_redir_start().
@ -114,8 +113,6 @@ Making everything work:
- expandcmd() with `=expr` in filename uses legacy expression. - expandcmd() with `=expr` in filename uses legacy expression.
- eval_expr() in ex_cexpr() - eval_expr() in ex_cexpr()
- eval_expr() call in dbg_parsearg() and debuggy_find() - eval_expr() call in dbg_parsearg() and debuggy_find()
- has() is compiled as a constant, but some checks are dynamic.
Check for dynamic values, such as "gui_running".
New syntax and functionality: New syntax and functionality:
Improve error checking: Improve error checking:
- "echo Func()" is an error if Func() does not return anything. - "echo Func()" is an error if Func() does not return anything.
@ -138,7 +135,7 @@ Also:
- implement enum - implement enum
- Make accessing varargs faster: arg[expr] - Make accessing varargs faster: arg[expr]
EVAL expr EVAL expr
LOADVARARG (varags idx) LOADVARARG (varargs idx)
- Make debugging work - at least per function. Need to recompile a function - Make debugging work - at least per function. Need to recompile a function
to step through it line-by-line? Evaluate the stack and variables on the to step through it line-by-line? Evaluate the stack and variables on the
stack? stack?
@ -348,6 +345,8 @@ Patch to make :q work with local arglist. (Christian Brabandt, #6286)
Why does Test_invalid_sid() not work in the GUI? Why does Test_invalid_sid() not work in the GUI?
":pedit" ignores the local working directory when 'pvp' is set (#7267)
Lua: updating wrong buffer when using newly created, unloaded buffer. Lua: updating wrong buffer when using newly created, unloaded buffer.
(#6539) (#6539)
@ -417,9 +416,6 @@ Another spurious BufDelete. (Dani Dickstein, #5701)
Wrong error when using local arglist. (Harm te Hennepe, #6133) Wrong error when using local arglist. (Harm te Hennepe, #6133)
Request to support <Cmd> in mappings, similar to how Neovim does this.
(Daniel Hahler, #4784)
Test loose_clipboard() by selecting text before suspending. Test loose_clipboard() by selecting text before suspending.
Undo puts cursor in wrong line after "cG<Esc>" undo. Undo puts cursor in wrong line after "cG<Esc>" undo.
@ -441,9 +437,6 @@ Also put :argadd commands at the start for all buffers, so that their order
remains equal? Then %argdel to clean it up. Do try this with 'hidden' set. remains equal? Then %argdel to clean it up. Do try this with 'hidden' set.
Also #5326: netrw buffers are not restored. Also #5326: netrw buffers are not restored.
Alternate file is not set in the session file. Use setwintabvar("@#") ?
(#6714)
When 'backupdir' has a path ending in double slash (meaning: use full path of When 'backupdir' has a path ending in double slash (meaning: use full path of
the file) combined with 'patchmode' the file name is wrong. (#5791) the file) combined with 'patchmode' the file name is wrong. (#5791)
@ -1067,7 +1060,7 @@ neovim #7431)
Patch for improving detecting Ruby on Mac in configure. (Ilya Mikhaltsou, 2017 Patch for improving detecting Ruby on Mac in configure. (Ilya Mikhaltsou, 2017
Nov 21) Nov 21)
When t_Co is changed from termresponse, the OptionSet autocmmand event isn't When t_Co is changed from termresponse, the OptionSet autocommand event isn't
triggered. Use the code from the end of set_num_option() in triggered. Use the code from the end of set_num_option() in
set_color_count(). set_color_count().
@ -1352,6 +1345,9 @@ no longer support.
sort() is not stable when using numeric/float sort (Nikolay Pavlov, 2016 Sep sort() is not stable when using numeric/float sort (Nikolay Pavlov, 2016 Sep
4#1038) 4#1038)
sort() does not use 'smartcase' for the skip pattern, even though 'ignorecase'
is used. (Filipe Brandenburger, #7322)
+channel: +channel:
- Add a in_cb, invoked when the write buffer has become empty. (Matteo Landi) - Add a in_cb, invoked when the write buffer has become empty. (Matteo Landi)
- Add ch_readlines(): for a channel in NL mode, reads as many lines as are - Add ch_readlines(): for a channel in NL mode, reads as many lines as are
@ -2297,7 +2293,7 @@ Additional info by Dominique Pelle. (also on 2010 Apr 10)
CreateFile and CreateFileW are used without sharing, filewritable() fails when CreateFile and CreateFileW are used without sharing, filewritable() fails when
the file was already open (e.g. script is being sourced). Add FILE_SHARE_READ| the file was already open (e.g. script is being sourced). Add FILE_SHARE_READ|
FILE_SHARE_WRITE in mch_access()? (Phillippe Vaucher, 2010 Nov 2) FILE_SHARE_WRITE in mch_access()? (Philippe Vaucher, 2010 Nov 2)
Is ~/bin (literally) in $PATH supposed to work? (Paul, 2010 March 29) Is ~/bin (literally) in $PATH supposed to work? (Paul, 2010 March 29)
Looks like only bash can do it. (Yakov Lerner) Looks like only bash can do it. (Yakov Lerner)
@ -5933,7 +5929,7 @@ Writing files:
losing the original when writing twice. (Slootman) losing the original when writing twice. (Slootman)
7 On non-Unix machines, also overwrite the original file in some situations 7 On non-Unix machines, also overwrite the original file in some situations
(file system full, it's a link on an NFS partition). (file system full, it's a link on an NFS partition).
7 When editing a file, check that it has been change outside of Vim more 7 When editing a file, check that it has been changed outside of Vim more
often, not only when writing over it. E.g., at the time the swap file is often, not only when writing over it. E.g., at the time the swap file is
flushed. Or every ten seconds or so (use the time of day, check it before flushed. Or every ten seconds or so (use the time of day, check it before
waiting for a character to be typed). waiting for a character to be typed).

View File

@ -1,4 +1,4 @@
*usr_41.txt* For Vim version 8.2. Last change: 2020 Aug 30 *usr_41.txt* For Vim version 8.2. Last change: 2020 Nov 09
VIM USER MANUAL - by Bram Moolenaar VIM USER MANUAL - by Bram Moolenaar

View File

@ -1,4 +1,4 @@
*various.txt* For Vim version 8.2. Last change: 2020 Aug 20 *various.txt* For Vim version 8.2. Last change: 2020 Nov 16
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -142,15 +142,17 @@ g8 Print the hex values of the bytes used in the
quit quit
< <
*:z* *E144* *:z* *E144*
:{range}z[+-^.=]{count} Display several lines of text surrounding the line :[range]z[+-^.=][count] Display several lines of text surrounding the line
specified with {range}, or around the current line specified with [range], or around the current line
if there is no {range}. If there is a {count}, that's if there is no [range].
how many lines you'll see; if there is no {count} and
only one window then twice the value of the 'scroll'
option is used, otherwise the current window height
minus 3 is used.
If there is a {count} the 'window' option is set to If there is a [count], that's how many lines you'll
see; if there is no [count] and only one window then
twice the value of the 'scroll' option is used,
otherwise the current window height minus 3 is used.
This is the value of "scr" in the table below.
If there is a [count] the 'window' option is set to
its value. its value.
:z can be used either alone or followed by any of :z can be used either alone or followed by any of
@ -168,7 +170,7 @@ g8 Print the hex values of the bytes used in the
If the mark is "=", a line of dashes is printed If the mark is "=", a line of dashes is printed
around the current line. around the current line.
:{range}z#[+-^.=]{count} *:z#* :[range]z#[+-^.=][count] *:z#*
Like ":z", but number the lines. Like ":z", but number the lines.
*:=* *:=*

View File

@ -1331,7 +1331,7 @@ eventhandler() Returns 1 when inside an event handler and interactive
executable() Checks if a program or batch script can be executed. executable() Checks if a program or batch script can be executed.
filewritable() Checks if a file can be written. (Ron Aaron) filewritable() Checks if a file can be written. (Ron Aaron)
foldclosed() Find out if there is a closed fold. (Johannes Zellner). foldclosed() Find out if there is a closed fold. (Johannes Zellner).
foldcloseend() Find the end of a closed fold. foldclosedend() Find the end of a closed fold.
foldlevel() Find out the foldlevel. (Johannes Zellner) foldlevel() Find out the foldlevel. (Johannes Zellner)
foreground() Move the GUI window to the foreground. foreground() Move the GUI window to the foreground.
getchar() Get one character from the user. Can be used to define a getchar() Get one character from the user. Can be used to define a

View File

@ -42557,7 +42557,7 @@ Files: src/buffer.c, src/testdir/test_statusline.vim,
src/testdir/dumps/Test_statusline_1.dump src/testdir/dumps/Test_statusline_1.dump
Patch 8.2.0236 Patch 8.2.0236
Problem: MS-Windows uninstall doesn't delete vimtutur.bat. Problem: MS-Windows uninstall doesn't delete vimtutor.bat.
Solution: Change directory before deletion. (Ken Takata, closes #5603) Solution: Change directory before deletion. (Ken Takata, closes #5603)
Files: src/uninstall.c Files: src/uninstall.c

View File

@ -1,4 +1,4 @@
*vim9.txt* For Vim version 8.2. Last change: 2020 Oct 17 *vim9.txt* For Vim version 8.2. Last change: 2020 Nov 20
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -438,7 +438,7 @@ literally dictionaries were introduced in a backwards compatible way: >
let dict = #{key: value} let dict = #{key: value}
However, this #{} syntax is unlike any existing language. As it appears that However, this #{} syntax is unlike any existing language. As it appears that
using a literaly key is much more common than using an expression, and using a literal key is much more common than using an expression, and
considering that JavaScript uses this syntax, using the {} form for dictionary considering that JavaScript uses this syntax, using the {} form for dictionary
literals was considered a much more useful syntax. In Vim9 script the {} form literals was considered a much more useful syntax. In Vim9 script the {} form
uses literal keys: > uses literal keys: >

View File

@ -0,0 +1,21 @@
" Vim filetype plugin file
" Language: Protobuf Text Format
" Maintainer: Lakshay Garg <lakshayg@outlook.in>
" Last Change: 2020 Nov 17
" Homepage: https://github.com/lakshayg/vim-pbtxt
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo&vim
setlocal commentstring=#\ %s
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: nowrap sw=2 sts=2 ts=8 noet

View File

@ -404,6 +404,7 @@ an 50.90.120 &Syntax.PQ.Pam\ config :cal SetSyn("pamconf")<CR>
an 50.90.130 &Syntax.PQ.PApp :cal SetSyn("papp")<CR> an 50.90.130 &Syntax.PQ.PApp :cal SetSyn("papp")<CR>
an 50.90.140 &Syntax.PQ.Pascal :cal SetSyn("pascal")<CR> an 50.90.140 &Syntax.PQ.Pascal :cal SetSyn("pascal")<CR>
an 50.90.150 &Syntax.PQ.Password\ file :cal SetSyn("passwd")<CR> an 50.90.150 &Syntax.PQ.Password\ file :cal SetSyn("passwd")<CR>
an 50.90.490 &Syntax.PQ.Pbtxt :cal SetSyn("pbtxt")<CR>
an 50.90.160 &Syntax.PQ.PCCTS :cal SetSyn("pccts")<CR> an 50.90.160 &Syntax.PQ.PCCTS :cal SetSyn("pccts")<CR>
an 50.90.170 &Syntax.PQ.PDF :cal SetSyn("pdf")<CR> an 50.90.170 &Syntax.PQ.PDF :cal SetSyn("pdf")<CR>
an 50.90.180 &Syntax.PQ.Perl.Perl :cal SetSyn("perl")<CR> an 50.90.180 &Syntax.PQ.Perl.Perl :cal SetSyn("perl")<CR>

44
runtime/syntax/pbtxt.vim Normal file
View File

@ -0,0 +1,44 @@
" Vim syntax file
" Language: Protobuf Text Format
" Maintainer: Lakshay Garg <lakshayg@outlook.in>
" Last Change: 2020 Nov 17
" Homepage: https://github.com/lakshayg/vim-pbtxt
if exists("b:current_syntax")
finish
endif
let s:cpo_save = &cpo
set cpo&vim
syn case ignore
syn keyword pbtxtTodo TODO FIXME contained
syn keyword pbtxtBool true false contained
syn match pbtxtInt display "\<\(0\|[1-9]\d*\)\>"
syn match pbtxtHex display "\<0[xX]\x\+\>"
syn match pbtxtFloat display "\(0\|[1-9]\d*\)\=\.\d*"
syn match pbtxtMessage display "^\s*\w\+\s*{"me=e-1
syn match pbtxtField display "^\s*\w\+:"me=e-1
syn match pbtxtEnum display ":\s*\a\w\+"ms=s+1 contains=pbtxtBool
syn region pbtxtString start=+"+ skip=+\\"+ end=+"+ contains=@Spell
syn region pbtxtComment start="#" end="$" keepend contains=pbtxtTodo,@Spell
hi def link pbtxtTodo Todo
hi def link pbtxtBool Boolean
hi def link pbtxtInt Number
hi def link pbtxtHex Number
hi def link pbtxtFloat Float
hi def link pbtxtMessage Structure
hi def link pbtxtField Identifier
hi def link pbtxtEnum Define
hi def link pbtxtString String
hi def link pbtxtComment Comment
let b:current_syntax = "pbtxt"
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: nowrap sw=2 sts=2 ts=8 noet

View File

@ -319,7 +319,7 @@ NOTE: Pressing just the motion while in Normal mode without an operator will
---> 6) Sugar is sweet ---> 6) Sugar is sweet
---> 7) And so are you. ---> 7) And so are you.
Doubling to operate on a line also works for operators mentioned below Doubling to operate on a line also works for operators mentioned below.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lesson 2.7: THE UNDO COMMAND Lesson 2.7: THE UNDO COMMAND
@ -433,7 +433,7 @@ NOTE: Remember that you should be learning by doing, not memorization.
---> This line has a few words that need changing using the change operator. ---> This line has a few words that need changing using the change operator.
Notice that ce deletes the word and places you in Insert mode. Notice that ce deletes the word and places you in Insert mode.
cc does the same for the whole line cc does the same for the whole line.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -804,7 +804,7 @@ NOTE: Replace mode is like Insert mode, but every typed character deletes an
b) b)
NOTE: You can also use y as an operator: yw yanks one word, NOTE: You can also use y as an operator: yw yanks one word,
yy yanks the whole line, then p puts that line yy yanks the whole line, then p puts that line.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lesson 6.5: SET OPTION Lesson 6.5: SET OPTION

View File

@ -319,7 +319,7 @@ NOTE: Pressing just the motion while in Normal mode without an operator will
---> 6) Sugar is sweet ---> 6) Sugar is sweet
---> 7) And so are you. ---> 7) And so are you.
Doubling to operate on a line also works for operators mentioned below Doubling to operate on a line also works for operators mentioned below.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lesson 2.7: THE UNDO COMMAND Lesson 2.7: THE UNDO COMMAND
@ -433,7 +433,7 @@ NOTE: Remember that you should be learning by doing, not memorization.
---> This line has a few words that need changing using the change operator. ---> This line has a few words that need changing using the change operator.
Notice that ce deletes the word and places you in Insert mode. Notice that ce deletes the word and places you in Insert mode.
cc does the same for the whole line cc does the same for the whole line.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -804,7 +804,7 @@ NOTE: Replace mode is like Insert mode, but every typed character deletes an
b) b)
NOTE: You can also use y as an operator: yw yanks one word, NOTE: You can also use y as an operator: yw yanks one word,
yy yanks the whole line, then p puts that line yy yanks the whole line, then p puts that line.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lesson 6.5: SET OPTION Lesson 6.5: SET OPTION