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
" Language: C
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2018 Aug 20
" Last Change: 2020 Apr 08
let s:cpo_save = &cpo
set cpo&vim
@ -635,3 +635,5 @@ endfunc
let &cpo = 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
"
" 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
" faster.
@ -325,7 +325,7 @@ endfunc
func dist#ft#FTmm()
let n = 1
while n < 10
while n < 20
let line = getline(n)
if line =~ '^\s*\(#\s*\(include\|import\)\>\|@import\>\|/\*\)'
setf objcpp

View File

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

View File

@ -4446,10 +4446,11 @@ getcompletion({pat}, {type} [, {filtered}]) *getcompletion()*
*getcurpos()*
getcurpos() Get the position of the cursor. This is like getpos('.'), but
includes an extra item in the list:
[bufnum, lnum, col, off, curswant] ~
The "curswant" number is the preferred column when moving the
includes an extra "curswant" in the list:
[0, lnum, col, off, curswant] ~
The "curswant" number is the preferred column when moving the
cursor vertically. Also see |getpos()|.
The first "bufnum" item is always zero.
This can be used to save and restore the cursor position: >
let save_cursor = getcurpos()
@ -7790,18 +7791,10 @@ settagstack({nr}, {dict} [, {action}]) *settagstack()*
Returns zero for success, -1 for failure.
Examples:
Set current index of the tag stack to 4: >
call settagstack(1005, {'curidx' : 4})
< Empty the tag stack of window 3: >
Examples (for more examples see |tagstack-examples||):
Empty the tag stack of window 3: >
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: >
let stack = gettagstack(1003)
" 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
them optional for function calls. When a positional argument is not
specified at a call, the default expression is used to initialize it.
This only works for functions declared with |function|, not for lambda
expressions |expr-lambda|.
This only works for functions declared with |function|, not for
lambda expressions |expr-lambda|.
Example: >
function Something(key, value = 10)
@ -9611,9 +9604,10 @@ Example that does NOT work: >
:function NoGood(first = a:second, second = 10)
:endfunction
<
When not using "...", the number of arguments in a function call must be equal
to the number of mandatory named arguments. When using "...", the number of
arguments may be larger.
When not using "...", the number of arguments in a function call must be at
least equal to the number of mandatory named arguments. When using "...", the
number of arguments may be larger than the total of mandatory and optional
arguments.
*local-variables*
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
|List| item.
:let [{name}, ..., ; {lastname}] = {expr1}
:let [{name}, ..., ; {lastname}] = {expr1} *E452*
Like |:let-unpack| above, but the |List| may have more
items than there are names. A list of the remaining
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".
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|.
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*
BASIC:
|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
|iccf| Helping poor children in Uganda
|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.
The '.' register (last inserted text) is still inserted as
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*
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!
The '.' register (last inserted text) is still inserted as
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*
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!
The '.' register (last inserted text) is still inserted as
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*
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
|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*
When you try to use the tag stack while it doesn't contain anything you will
get an error message.

View File

@ -84,7 +84,7 @@ browser. This is what you get: >
a................Hiding Files or Directories................|netrw-a|
mb...............Bookmarking a Directory....................|netrw-mb|
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................Deleting Files or Directories..............|netrw-D|
<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:
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
|g:netrw_keepdir| to control this, too)
R Rename the file or directory under the cursor; a

View File

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

View File

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

View File

@ -1,7 +1,9 @@
" Vim indent file
" Language: reStructuredText Documentation Format
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2011-08-03
" Vim reST indent file
" Language: reStructuredText Documentation Format
" Maintainer: Marshall Ward <marshall.ward@gmail.com>
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2020-03-31
if exists("b:did_indent")
finish
@ -18,6 +20,12 @@ endif
let s:itemization_pattern = '^\s*[-*+]\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()
let lnum = prevnonblank(v:lnum - 1)
@ -28,6 +36,13 @@ function GetRSTIndent()
let ind = indent(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
let ind += 2
elseif line =~ s:enumeration_pattern

View File

@ -1,9 +1,9 @@
" Vim syntax file
" Vim reST syntax file
" Language: reStructuredText documentation format
" Maintainer: Marshall Ward <marshall.ward@gmail.com>
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Website: https://github.com/marshallward/vim-restructuredtext
" Latest Revision: 2018-12-29
" Latest Revision: 2020-03-31
if exists("b:current_syntax")
finish
@ -21,7 +21,7 @@ syn cluster rstCruft contains=rstEmphasis,rstStrongEmphasis,
\ rstInlineInternalTargets,rstFootnoteReference,rstHyperlinkReference
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
syn region rstQuotedLiteralBlock matchgroup=rstDelimiter
@ -90,16 +90,28 @@ execute 'syn match rstSubstitutionDefinition contained' .
\ ' /|.*|\_s\+/ nextgroup=@rstDirectives'
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 .
\ ' start=+' . a:char_left . '\zs' . a:start .
\ '\ze[^[:space:]' . a:char_right . a:start[strlen(a:start) - 1] . ']+' .
\ 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
function! s:DefineInlineMarkup(name, start, middle, end)
let middle = a:middle != "" ?
\ (' skip=+\\\\\|\\' . a:middle . '+') :
\ (' skip=+\\\\\|\\' . a:middle . '\|\s' . a:middle . '+') :
\ ""
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:]/]"
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=+^$+
\ end=+^\z1\@!+
\ contains=@NoSpell

View File

@ -3,7 +3,7 @@
" Maintainer: Daniel Kho <daniel.kho@logik.haus>
" Previous Maintainer: Czo <Olivier.Sirol@lip6.fr>
" 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
if exists("b:current_syntax")
@ -16,10 +16,10 @@ set cpo&vim
" case is not significant
syn case ignore
" VHDL keywords
syn keyword vhdlStatement access after alias all assert
" VHDL 1076-2019 keywords
syn keyword vhdlStatement access after alias all
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 case component configuration constant
syn keyword vhdlStatement context cover
@ -34,20 +34,19 @@ syn keyword vhdlStatement map
syn keyword vhdlStatement new next null
syn keyword vhdlStatement of on open others out
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 release restrict restrict_guarantee
syn keyword vhdlStatement select severity signal shared
syn keyword vhdlStatement subtype
syn keyword vhdlStatement release restrict
syn keyword vhdlStatement select severity signal shared subtype
syn keyword vhdlStatement sequence strong
syn keyword vhdlStatement then to transport type
syn keyword vhdlStatement unaffected units until use
syn keyword vhdlStatement variable
" VHDL-2019 interface
syn keyword vhdlStatement view
syn keyword vhdlStatement vmode vprop vunit
syn keyword vhdlStatement variable view
syn keyword vhdlStatement vpkg vmode vprop vunit
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.
syn match vhdlStatement "\<\(if\|else\)\>"
@ -265,4 +264,5 @@ let b:current_syntax = "vhdl"
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: ts=8

View File

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