vim-patch:d1caa941d876

Update runtime files
d1caa941d8

Cherry-pick error E452 from patch v8.2.0486.
This commit is contained in:
Jan Edmund Lazo 2021-04-27 21:48:38 -04:00
parent d894b3da1e
commit e612a0a76a
No known key found for this signature in database
GPG Key ID: 64915E6E9F735B15
14 changed files with 107 additions and 52 deletions

View File

@ -1,7 +1,7 @@
" Vim completion script " Vim completion script
" Language: C " Language: C
" Maintainer: Bram Moolenaar <Bram@vim.org> " Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2018 Aug 20 " Last Change: 2020 Apr 08
let s:cpo_save = &cpo let s:cpo_save = &cpo
set cpo&vim set cpo&vim
@ -635,3 +635,5 @@ endfunc
let &cpo = s:cpo_save let &cpo = s:cpo_save
unlet s:cpo_save unlet s:cpo_save
" vim: noet sw=2 sts=2

View File

@ -1,7 +1,7 @@
" Vim functions for file type detection " Vim functions for file type detection
" "
" Maintainer: Bram Moolenaar <Bram@vim.org> " Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2020 Jan 02 " Last Change: 2020 Mar 30
" These functions are moved here from runtime/filetype.vim to make startup " These functions are moved here from runtime/filetype.vim to make startup
" faster. " faster.
@ -325,7 +325,7 @@ endfunc
func dist#ft#FTmm() func dist#ft#FTmm()
let n = 1 let n = 1
while n < 10 while n < 20
let line = getline(n) let line = getline(n)
if line =~ '^\s*\(#\s*\(include\|import\)\>\|@import\>\|/\*\)' if line =~ '^\s*\(#\s*\(include\|import\)\>\|@import\>\|/\*\)'
setf objcpp setf objcpp

View File

@ -1402,7 +1402,7 @@ text. Put it in your autoload directory, e.g. ~/.vim/autoload/format.vim: >
func! format#Format() func! format#Format()
" only reformat on explicit gq command " only reformat on explicit gq command
if mode() != 'n' if mode() != 'n'
" fall back to Vims internal reformatting " fall back to Vim's internal reformatting
return 1 return 1
endif endif
let lines = getline(v:lnum, v:lnum + v:count - 1) let lines = getline(v:lnum, v:lnum + v:count - 1)

View File

@ -4446,10 +4446,11 @@ getcompletion({pat}, {type} [, {filtered}]) *getcompletion()*
*getcurpos()* *getcurpos()*
getcurpos() Get the position of the cursor. This is like getpos('.'), but getcurpos() Get the position of the cursor. This is like getpos('.'), but
includes an extra item in the list: includes an extra "curswant" in the list:
[bufnum, lnum, col, off, curswant] ~ [0, lnum, col, off, curswant] ~
The "curswant" number is the preferred column when moving the The "curswant" number is the preferred column when moving the
cursor vertically. Also see |getpos()|. cursor vertically. Also see |getpos()|.
The first "bufnum" item is always zero.
This can be used to save and restore the cursor position: > This can be used to save and restore the cursor position: >
let save_cursor = getcurpos() let save_cursor = getcurpos()
@ -7790,18 +7791,10 @@ settagstack({nr}, {dict} [, {action}]) *settagstack()*
Returns zero for success, -1 for failure. Returns zero for success, -1 for failure.
Examples: Examples (for more examples see |tagstack-examples||):
Set current index of the tag stack to 4: > Empty the tag stack of window 3: >
call settagstack(1005, {'curidx' : 4})
< Empty the tag stack of window 3: >
call settagstack(3, {'items' : []}) call settagstack(3, {'items' : []})
< Push a new item onto the tag stack: >
let pos = [bufnr('myfile.txt'), 10, 1, 0]
let newtag = [{'tagname' : 'mytag', 'from' : pos}]
call settagstack(2, {'items' : newtag}, 'a')
< Save and restore the tag stack: > < Save and restore the tag stack: >
let stack = gettagstack(1003) let stack = gettagstack(1003)
" do something else " do something else
@ -9581,8 +9574,8 @@ It is allowed to define another function inside a function body.
You can provide default values for positional named arguments. This makes You can provide default values for positional named arguments. This makes
them optional for function calls. When a positional argument is not them optional for function calls. When a positional argument is not
specified at a call, the default expression is used to initialize it. specified at a call, the default expression is used to initialize it.
This only works for functions declared with |function|, not for lambda This only works for functions declared with |function|, not for
expressions |expr-lambda|. lambda expressions |expr-lambda|.
Example: > Example: >
function Something(key, value = 10) function Something(key, value = 10)
@ -9611,9 +9604,10 @@ Example that does NOT work: >
:function NoGood(first = a:second, second = 10) :function NoGood(first = a:second, second = 10)
:endfunction :endfunction
< <
When not using "...", the number of arguments in a function call must be equal When not using "...", the number of arguments in a function call must be at
to the number of mandatory named arguments. When using "...", the number of least equal to the number of mandatory named arguments. When using "...", the
arguments may be larger. number of arguments may be larger than the total of mandatory and optional
arguments.
*local-variables* *local-variables*
Inside a function local variables can be used. These will disappear when the Inside a function local variables can be used. These will disappear when the
@ -9943,7 +9937,7 @@ This does NOT work: >
Like above, but append/add/subtract the value for each Like above, but append/add/subtract the value for each
|List| item. |List| item.
:let [{name}, ..., ; {lastname}] = {expr1} :let [{name}, ..., ; {lastname}] = {expr1} *E452*
Like |:let-unpack| above, but the |List| may have more Like |:let-unpack| above, but the |List| may have more
items than there are names. A list of the remaining items than there are names. A list of the remaining
items is assigned to {lastname}. If there are no items is assigned to {lastname}. If there are no

View File

@ -30,7 +30,7 @@ Get specific help: It is possible to go directly to whatever you want help
help entries for "word". help entries for "word".
Or use ":helpgrep word". |:helpgrep| Or use ":helpgrep word". |:helpgrep|
Getting started: Do the Vim tutor, a 20 minute interactive training for the Getting started: Do the Vim tutor, a 30-minute interactive course for the
basic commands, see |vimtutor|. basic commands, see |vimtutor|.
Read the user manual from start to end: |usr_01.txt| Read the user manual from start to end: |usr_01.txt|
@ -40,7 +40,7 @@ through the help of many others. See |credits|.
*doc-file-list* *Q_ct* *doc-file-list* *Q_ct*
BASIC: BASIC:
|quickref| Overview of the most common commands you will use |quickref| Overview of the most common commands you will use
|tutor| 20 minutes training course for beginners |tutor| 30-minute interactive course for beginners
|copying| About copyrights |copying| About copyrights
|iccf| Helping poor children in Uganda |iccf| Helping poor children in Uganda
|sponsor| Sponsor Vim development, become a registered Vim user |sponsor| Sponsor Vim development, become a registered Vim user

View File

@ -143,6 +143,8 @@ CTRL-R CTRL-R {register} *i_CTRL-R_CTRL-R*
you also want to avoid these, use CTRL-R CTRL-O, see below. you also want to avoid these, use CTRL-R CTRL-O, see below.
The '.' register (last inserted text) is still inserted as The '.' register (last inserted text) is still inserted as
typed. typed.
After this command, the '.' register contains the text from
the register as if it was inserted by typing it.
CTRL-R CTRL-O {register} *i_CTRL-R_CTRL-O* CTRL-R CTRL-O {register} *i_CTRL-R_CTRL-O*
Insert the contents of a register literally and don't Insert the contents of a register literally and don't
@ -152,6 +154,9 @@ CTRL-R CTRL-O {register} *i_CTRL-R_CTRL-O*
Does not replace characters! Does not replace characters!
The '.' register (last inserted text) is still inserted as The '.' register (last inserted text) is still inserted as
typed. typed.
After this command, the '.' register contains the command
typed and not the text. I.e., the literals "^R^O" and not the
text from the register.
CTRL-R CTRL-P {register} *i_CTRL-R_CTRL-P* CTRL-R CTRL-P {register} *i_CTRL-R_CTRL-P*
Insert the contents of a register literally and fix the Insert the contents of a register literally and fix the
@ -159,6 +164,9 @@ CTRL-R CTRL-P {register} *i_CTRL-R_CTRL-P*
Does not replace characters! Does not replace characters!
The '.' register (last inserted text) is still inserted as The '.' register (last inserted text) is still inserted as
typed. typed.
After this command, the '.' register contains the command
typed and not the text. I.e., the literals "^R^P" and not the
text from the register.
*i_CTRL-T* *i_CTRL-T*
CTRL-T Insert one shiftwidth of indent at the start of the current CTRL-T Insert one shiftwidth of indent at the start of the current

View File

@ -179,6 +179,29 @@ commands explained above the tag stack will look like this:
The |gettagstack()| function returns the tag stack of a specified window. The The |gettagstack()| function returns the tag stack of a specified window. The
|settagstack()| function modifies the tag stack of a window. |settagstack()| function modifies the tag stack of a window.
*tagstack-examples*
Write to the tag stack just like `:tag` but with a user-defined
jumper#jump_to_tag function: >
" Store where we're jumping from before we jump.
let tag = expand('<cword>')
let pos = [bufnr()] + getcurpos()[1:]
let item = {'bufnr': pos[0], 'from': pos, 'tagname': tag}
if jumper#jump_to_tag(tag)
" Jump was successful, write previous location to tag stack.
let winid = win_getid()
let stack = gettagstack(winid)
let stack['items'] = [item]
call settagstack(winid, stack, 't')
endif
<
Set current index of the tag stack to 4: >
call settagstack(1005, {'curidx' : 4})
<
Push a new item onto the tag stack: >
let pos = [bufnr('myfile.txt'), 10, 1, 0]
let newtag = [{'tagname' : 'mytag', 'from' : pos}]
call settagstack(2, {'items' : newtag}, 'a')
<
*E73* *E73*
When you try to use the tag stack while it doesn't contain anything you will When you try to use the tag stack while it doesn't contain anything you will
get an error message. get an error message.

View File

@ -84,7 +84,7 @@ browser. This is what you get: >
a................Hiding Files or Directories................|netrw-a| a................Hiding Files or Directories................|netrw-a|
mb...............Bookmarking a Directory....................|netrw-mb| mb...............Bookmarking a Directory....................|netrw-mb|
gb...............Changing to a Bookmarked Directory.........|netrw-gb| gb...............Changing to a Bookmarked Directory.........|netrw-gb|
c................Make Browsing Directory The Current Dir....|netrw-c| cd...............Make Browsing Directory The Current Dir....|netrw-c|
d................Make A New Directory.......................|netrw-d| d................Make A New Directory.......................|netrw-d|
D................Deleting Files or Directories..............|netrw-D| D................Deleting Files or Directories..............|netrw-D|
<c-h>............Edit File/Directory Hiding List............|netrw-ctrl-h| <c-h>............Edit File/Directory Hiding List............|netrw-ctrl-h|
@ -121,7 +121,7 @@ The following normal-mode commands may be used to control the browser display:
As a sampling of extra normal-mode commands: As a sampling of extra normal-mode commands:
c Change Vim's notion of the current directory to be cd Change Vim's notion of the current directory to be
the same as the browser directory. (see the same as the browser directory. (see
|g:netrw_keepdir| to control this, too) |g:netrw_keepdir| to control this, too)
R Rename the file or directory under the cursor; a R Rename the file or directory under the cursor; a

View File

@ -505,6 +505,7 @@ Test functions:
test_null_blob() test_null_blob()
test_null_channel() test_null_channel()
test_null_dict() test_null_dict()
test_null_function()
test_null_job() test_null_job()
test_null_list() test_null_list()
test_null_partial() test_null_partial()

View File

@ -3,7 +3,7 @@
" Maintainer: Marshall Ward <marshall.ward@gmail.com> " Maintainer: Marshall Ward <marshall.ward@gmail.com>
" Original Maintainer: Nikolai Weibull <now@bitwi.se> " Original Maintainer: Nikolai Weibull <now@bitwi.se>
" Website: https://github.com/marshallward/vim-restructuredtext " Website: https://github.com/marshallward/vim-restructuredtext
" Latest Revision: 2018-12-29 " Latest Revision: 2020-03-31
if exists("b:did_ftplugin") if exists("b:did_ftplugin")
finish finish
@ -34,7 +34,7 @@ if exists("g:rst_style") && g:rst_style != 0
setlocal expandtab shiftwidth=3 softtabstop=3 tabstop=8 setlocal expandtab shiftwidth=3 softtabstop=3 tabstop=8
endif endif
if has('patch-7.3.867') " Introduced the TextChanged event. if g:rst_fold_enabled != 0 && has('patch-7.3.867') " Introduced the TextChanged event.
setlocal foldmethod=expr setlocal foldmethod=expr
setlocal foldexpr=RstFold#GetRstFold() setlocal foldexpr=RstFold#GetRstFold()
setlocal foldtext=RstFold#GetRstFoldText() setlocal foldtext=RstFold#GetRstFoldText()

View File

@ -1,7 +1,9 @@
" Vim indent file " Vim indent file
" Language: reStructuredText Documentation Format " Vim reST indent file
" Previous Maintainer: Nikolai Weibull <now@bitwi.se> " Language: reStructuredText Documentation Format
" Latest Revision: 2011-08-03 " Maintainer: Marshall Ward <marshall.ward@gmail.com>
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2020-03-31
if exists("b:did_indent") if exists("b:did_indent")
finish finish
@ -18,6 +20,12 @@ endif
let s:itemization_pattern = '^\s*[-*+]\s' let s:itemization_pattern = '^\s*[-*+]\s'
let s:enumeration_pattern = '^\s*\%(\d\+\|#\)\.\s\+' let s:enumeration_pattern = '^\s*\%(\d\+\|#\)\.\s\+'
let s:note_pattern = '^\.\. '
function! s:get_paragraph_start()
let paragraph_mark_start = getpos("'{")[1]
return getline(paragraph_mark_start) =~ '\S' ? paragraph_mark_start : paragraph_mark_start + 1
endfunction
function GetRSTIndent() function GetRSTIndent()
let lnum = prevnonblank(v:lnum - 1) let lnum = prevnonblank(v:lnum - 1)
@ -28,6 +36,13 @@ function GetRSTIndent()
let ind = indent(lnum) let ind = indent(lnum)
let line = getline(lnum) let line = getline(lnum)
let psnum = s:get_paragraph_start()
if psnum != 0
if getline(psnum) =~ s:note_pattern
let ind = 3
endif
endif
if line =~ s:itemization_pattern if line =~ s:itemization_pattern
let ind += 2 let ind += 2
elseif line =~ s:enumeration_pattern elseif line =~ s:enumeration_pattern

View File

@ -1,9 +1,9 @@
" Vim syntax file " Vim reST syntax file
" Language: reStructuredText documentation format " Language: reStructuredText documentation format
" Maintainer: Marshall Ward <marshall.ward@gmail.com> " Maintainer: Marshall Ward <marshall.ward@gmail.com>
" Previous Maintainer: Nikolai Weibull <now@bitwi.se> " Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Website: https://github.com/marshallward/vim-restructuredtext " Website: https://github.com/marshallward/vim-restructuredtext
" Latest Revision: 2018-12-29 " Latest Revision: 2020-03-31
if exists("b:current_syntax") if exists("b:current_syntax")
finish finish
@ -21,7 +21,7 @@ syn cluster rstCruft contains=rstEmphasis,rstStrongEmphasis,
\ rstInlineInternalTargets,rstFootnoteReference,rstHyperlinkReference \ rstInlineInternalTargets,rstFootnoteReference,rstHyperlinkReference
syn region rstLiteralBlock matchgroup=rstDelimiter syn region rstLiteralBlock matchgroup=rstDelimiter
\ start='::\_s*\n\ze\z(\s\+\)' skip='^$' end='^\z1\@!' \ start='\(^\z(\s*\).*\)\@<=::\n\s*\n' skip='^\s*$' end='^\(\z1\s\+\)\@!'
\ contains=@NoSpell \ contains=@NoSpell
syn region rstQuotedLiteralBlock matchgroup=rstDelimiter syn region rstQuotedLiteralBlock matchgroup=rstDelimiter
@ -90,16 +90,28 @@ execute 'syn match rstSubstitutionDefinition contained' .
\ ' /|.*|\_s\+/ nextgroup=@rstDirectives' \ ' /|.*|\_s\+/ nextgroup=@rstDirectives'
function! s:DefineOneInlineMarkup(name, start, middle, end, char_left, char_right) function! s:DefineOneInlineMarkup(name, start, middle, end, char_left, char_right)
" Only escape the first char of a multichar delimiter (e.g. \* inside **)
if a:start[0] == '\'
let first = a:start[0:1]
else
let first = a:start[0]
endif
execute 'syn match rstEscape'.a:name.' +\\\\\|\\'.first.'+'.' contained'
execute 'syn region rst' . a:name . execute 'syn region rst' . a:name .
\ ' start=+' . a:char_left . '\zs' . a:start . \ ' start=+' . a:char_left . '\zs' . a:start .
\ '\ze[^[:space:]' . a:char_right . a:start[strlen(a:start) - 1] . ']+' . \ '\ze[^[:space:]' . a:char_right . a:start[strlen(a:start) - 1] . ']+' .
\ a:middle . \ a:middle .
\ ' end=+\S' . a:end . '\ze\%($\|\s\|[''")\]}>/:.,;!?\\-]\)+' \ ' end=+' . a:end . '\ze\%($\|\s\|[''")\]}>/:.,;!?\\-]\)+' .
\ ' contains=rstEscape' . a:name
execute 'hi def link rstEscape'.a:name.' Special'
endfunction endfunction
function! s:DefineInlineMarkup(name, start, middle, end) function! s:DefineInlineMarkup(name, start, middle, end)
let middle = a:middle != "" ? let middle = a:middle != "" ?
\ (' skip=+\\\\\|\\' . a:middle . '+') : \ (' skip=+\\\\\|\\' . a:middle . '\|\s' . a:middle . '+') :
\ "" \ ""
call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, "'", "'") call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, "'", "'")
@ -161,7 +173,7 @@ syn match rstStandaloneHyperlink contains=@NoSpell
\ "\<\%(\%(\%(https\=\|file\|ftp\|gopher\)://\|\%(mailto\|news\):\)[^[:space:]'\"<>]\+\|www[[:alnum:]_-]*\.[[:alnum:]_-]\+\.[^[:space:]'\"<>]\+\)[[:alnum:]/]" \ "\<\%(\%(\%(https\=\|file\|ftp\|gopher\)://\|\%(mailto\|news\):\)[^[:space:]'\"<>]\+\|www[[:alnum:]_-]*\.[[:alnum:]_-]\+\.[^[:space:]'\"<>]\+\)[[:alnum:]/]"
syn region rstCodeBlock contained matchgroup=rstDirective syn region rstCodeBlock contained matchgroup=rstDirective
\ start=+\%(sourcecode\|code\%(-block\)\=\)::\s\+.*\_s*\n\ze\z(\s\+\)+ \ start=+\%(sourcecode\|code\%(-block\)\=\)::\s*\(\S*\)\?\s*\n\%(\s*:.*:\s*.*\s*\n\)*\n\ze\z(\s\+\)+
\ skip=+^$+ \ skip=+^$+
\ end=+^\z1\@!+ \ end=+^\z1\@!+
\ contains=@NoSpell \ contains=@NoSpell

View File

@ -3,7 +3,7 @@
" Maintainer: Daniel Kho <daniel.kho@logik.haus> " Maintainer: Daniel Kho <daniel.kho@logik.haus>
" Previous Maintainer: Czo <Olivier.Sirol@lip6.fr> " Previous Maintainer: Czo <Olivier.Sirol@lip6.fr>
" Credits: Stephan Hegel <stephan.hegel@snc.siemens.com.cn> " Credits: Stephan Hegel <stephan.hegel@snc.siemens.com.cn>
" Last Changed: 2020 Mar 09 by Daniel Kho " Last Changed: 2020 Apr 04 by Daniel Kho
" quit when a syntax file was already loaded " quit when a syntax file was already loaded
if exists("b:current_syntax") if exists("b:current_syntax")
@ -16,10 +16,10 @@ set cpo&vim
" case is not significant " case is not significant
syn case ignore syn case ignore
" VHDL keywords " VHDL 1076-2019 keywords
syn keyword vhdlStatement access after alias all assert syn keyword vhdlStatement access after alias all
syn keyword vhdlStatement architecture array attribute syn keyword vhdlStatement architecture array attribute
syn keyword vhdlStatement assume assume_guarantee syn keyword vhdlStatement assert assume
syn keyword vhdlStatement begin block body buffer bus syn keyword vhdlStatement begin block body buffer bus
syn keyword vhdlStatement case component configuration constant syn keyword vhdlStatement case component configuration constant
syn keyword vhdlStatement context cover syn keyword vhdlStatement context cover
@ -34,20 +34,19 @@ syn keyword vhdlStatement map
syn keyword vhdlStatement new next null syn keyword vhdlStatement new next null
syn keyword vhdlStatement of on open others out syn keyword vhdlStatement of on open others out
syn keyword vhdlStatement package port postponed procedure process pure syn keyword vhdlStatement package port postponed procedure process pure
syn keyword vhdlStatement parameter property protected syn keyword vhdlStatement parameter property protected private
syn keyword vhdlStatement range record register reject report return syn keyword vhdlStatement range record register reject report return
syn keyword vhdlStatement release restrict restrict_guarantee syn keyword vhdlStatement release restrict
syn keyword vhdlStatement select severity signal shared syn keyword vhdlStatement select severity signal shared subtype
syn keyword vhdlStatement subtype
syn keyword vhdlStatement sequence strong syn keyword vhdlStatement sequence strong
syn keyword vhdlStatement then to transport type syn keyword vhdlStatement then to transport type
syn keyword vhdlStatement unaffected units until use syn keyword vhdlStatement unaffected units until use
syn keyword vhdlStatement variable syn keyword vhdlStatement variable view
" VHDL-2019 interface syn keyword vhdlStatement vpkg vmode vprop vunit
syn keyword vhdlStatement view
syn keyword vhdlStatement vmode vprop vunit
syn keyword vhdlStatement wait when while with syn keyword vhdlStatement wait when while with
syn keyword vhdlStatement note warning error failure
" VHDL predefined severity levels
syn keyword vhdlAttribute note warning error failure
" Linting of conditionals. " Linting of conditionals.
syn match vhdlStatement "\<\(if\|else\)\>" syn match vhdlStatement "\<\(if\|else\)\>"
@ -265,4 +264,5 @@ let b:current_syntax = "vhdl"
let &cpo = s:cpo_save let &cpo = s:cpo_save
unlet s:cpo_save unlet s:cpo_save
" vim: ts=8 " vim: ts=8

View File

@ -1575,7 +1575,7 @@ static const char_u *skip_var_list(const char_u *arg, int *var_count,
break; break;
else if (*p == ';') { else if (*p == ';') {
if (*semicolon == 1) { if (*semicolon == 1) {
EMSG(_("Double ; in list of variables")); EMSG(_("E452: Double ; in list of variables"));
return NULL; return NULL;
} }
*semicolon = 1; *semicolon = 1;