From f0bf853f41ac4ad765bf279c331669d8c9d1e5c5 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Fri, 23 Apr 2021 19:23:58 -0400 Subject: [PATCH] vim-patch:2e693a88b24d Update runtime files. https://github.com/vim/vim/commit/2e693a88b24dc6b12883fad78ff2cb9cd4469c98 --- runtime/doc/eval.txt | 68 +++++++++++++++++++++++----------- runtime/doc/if_perl.txt | 13 ++++--- runtime/doc/if_ruby.txt | 10 ++--- runtime/doc/indent.txt | 6 ++- runtime/doc/options.txt | 2 +- runtime/doc/syntax.txt | 4 +- runtime/indent/testdir/yaml.in | 14 +++++++ runtime/indent/testdir/yaml.ok | 14 +++++++ runtime/indent/yaml.vim | 4 +- runtime/syntax/named.vim | 4 +- 10 files changed, 98 insertions(+), 41 deletions(-) create mode 100644 runtime/indent/testdir/yaml.in create mode 100644 runtime/indent/testdir/yaml.ok diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index bded8deb0f..685a6a52e8 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -2506,7 +2506,7 @@ win_id2tabwin({expr}) List get tab and window nr from |window-ID| win_id2win({expr}) Number get window nr from |window-ID| win_screenpos({nr}) List get screen position of window {nr} win_splitmove({nr}, {target} [, {options}]) - none move window {nr} to split of {target} + Number move window {nr} to split of {target} winbufnr({nr}) Number buffer number of window {nr} wincol() Number window column of the cursor winheight({nr}) Number height of window {nr} @@ -2585,6 +2585,9 @@ append({lnum}, {text}) *append()* appendbufline({expr}, {lnum}, {text}) *appendbufline()* Like |append()| but append the text in buffer {expr}. + This function works only for loaded buffers. First call + |bufload()| if needed. + For the use of {expr}, see |bufname()|. {lnum} is used like with |append()|. Note that using |line()| @@ -3335,6 +3338,9 @@ deletebufline({expr}, {first}[, {last}]) *deletebufline()* If {last} is omitted then delete line {first} only. On success 0 is returned, on failure 1 is returned. + This function works only for loaded buffers. First call + |bufload()| if needed. + For the use of {expr}, see |bufname()| above. {first} and {last} are used like with |setline()|. Note that @@ -7369,13 +7375,24 @@ serverstop({address}) *serverstop()* address returned by |serverlist()|. setbufline({expr}, {lnum}, {text}) *setbufline()* - Set line {lnum} to {text} in buffer {expr}. To insert - lines use |append()|. + Set line {lnum} to {text} in buffer {expr}. This works like + |setline()| for the specified buffer. + + This function works only for loaded buffers. First call + |bufload()| if needed. + + To insert lines use |appendbufline()|. + Any text properties in {lnum} are cleared. + + {text} can be a string to set one line, or a list of strings + to set multiple lines. If the list extends below the last + line then those lines are added. For the use of {expr}, see |bufname()| above. {lnum} is used like with |setline()|. - This works like |setline()| for the specified buffer. + When {lnum} is just below the last line the {text} will be + added below the last line. On success 0 is returned, on failure 1 is returned. If {expr} is not a valid buffer or {lnum} is not valid, an @@ -7458,7 +7475,7 @@ setline({lnum}, {text}) *setline()* {lnum} is used like with |getline()|. When {lnum} is just below the last line the {text} will be - added as a new line. + added below the last line. If this succeeds, 0 is returned. If this fails (most likely because {lnum} is invalid) 1 is returned. @@ -9911,20 +9928,21 @@ This does NOT work: > *:let=<<* *:let-heredoc* *E990* *E991* *E172* *E221* -:let {var-name} =<< [trim] {marker} +:let {var-name} =<< [trim] {endmarker} text... text... -{marker} +{endmarker} Set internal variable {var-name} to a List containing - the lines of text bounded by the string {marker}. - {marker} cannot start with a lower case character. - The last line should end only with the {marker} string - without any other character. Watch out for white - space after {marker}! + the lines of text bounded by the string {endmarker}. + {endmarker} cannot start with a lower case character. + The last line should end only with the {endmarker} + string without any other character. Watch out for + white space after {endmarker}! Without "trim" any white space characters in the lines of text are preserved. If "trim" is specified before - {marker}, then indentation is stripped so you can do: > + {endmarker}, then indentation is stripped so you can + do: > let text =<< trim END if ok echo 'done' @@ -9938,23 +9956,31 @@ text... non-empty text line is stripped from the input lines. All leading indentation exactly matching the leading indentation before `let` is stripped from the line - containing {marker}. Note that the difference between - space and tab matters here. + containing {endmarker}. Note that the difference + between space and tab matters here. If {var-name} didn't exist yet, it is created. Cannot be followed by another command, but can be followed by a comment. + To avoid line continuation to be applied, consider + adding 'C' to 'cpoptions': > + set cpo+=C + let var =<< END + \ leading backslash + END + set cpo-=C +< Examples: > let var1 =<< END - Sample text 1 - Sample text 2 - Sample text 3 - END + Sample text 1 + Sample text 2 + Sample text 3 + END let data =<< trim DATA - 1 2 3 4 - 5 6 7 8 + 1 2 3 4 + 5 6 7 8 DATA < *E121* diff --git a/runtime/doc/if_perl.txt b/runtime/doc/if_perl.txt index f1d07ddb20..ddcf220844 100644 --- a/runtime/doc/if_perl.txt +++ b/runtime/doc/if_perl.txt @@ -22,14 +22,15 @@ See |provider-perl| for more information. :[range]perl << [endmarker] {script} {endmarker} - Execute perl script {script}. Useful for including - perl code in Vim scripts. Requires perl, see - |script-here|. + Execute perl script {script}. + The {endmarker} after {script} must NOT be preceded by + any white space. -The {endmarker} below the {script} must NOT be preceded by any white space. + If [endmarker] is omitted, it defaults to a dot '.' + like for the |:append| and |:insert| commands. -If [endmarker] is omitted from after the "<<", a dot '.' must be used after -{script}, like for the |:append| and |:insert| commands. + Useful for including perl code in Vim scripts. + Requires perl, see |script-here|. Example: > function! MyVimMethod() diff --git a/runtime/doc/if_ruby.txt b/runtime/doc/if_ruby.txt index c8d2409549..02edd50ae8 100644 --- a/runtime/doc/if_ruby.txt +++ b/runtime/doc/if_ruby.txt @@ -19,14 +19,14 @@ downloading Ruby there. :rub[y] {cmd} Execute Ruby command {cmd}. A command to try it out: > :ruby print "Hello" -:rub[y] << [endpattern] +:rub[y] << [endmarker] {script} -{endpattern} +{endmarker} Execute Ruby script {script}. - The {endpattern} after {script} must NOT be preceded - by any white space. + The {endmarker} after {script} must NOT be preceded by + any white space. - If [endpattern] is omitted, it defaults to a dot '.' + If [endmarker] is omitted, it defaults to a dot '.' like for the |:append| and |:insert| commands. This form of the |:ruby| command is mainly useful for diff --git a/runtime/doc/indent.txt b/runtime/doc/indent.txt index f2278f8453..2896709cd1 100644 --- a/runtime/doc/indent.txt +++ b/runtime/doc/indent.txt @@ -951,10 +951,12 @@ Function call arguments will indent 1 extra level. For two-space indentation: > ------------- *PHP_IndentFunctionDeclarationParameters* -Extra indentation levels to add to arguments in multi-line function definitions. > +Extra indentation levels to add to arguments in multi-line function +definitions. > let g:PHP_IndentFunctionDeclarationParameters = 1 -Function arguments in declarations will indent 1 extra level. For two-space indentation: > +Function arguments in declarations will indent 1 extra level. For two-space +indentation: > function call_the_thing( $with_this, diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index b57a77a952..9d94b568a4 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1392,7 +1392,7 @@ A jump table for the options with a short description can be found at |Q_op|. *'completeslash'* *'csl'* 'completeslash' 'csl' string (default: "") local to buffer - {not in Vi} {only for MS-Windows} + {only for MS-Windows} When this option is set it overrules 'shellslash' for completion: - When this option is set to "slash", a forward slash is used for path completion in insert mode. This is useful when editing HTML tag, or diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index 7491577d8b..e527ef2158 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -37,8 +37,8 @@ If the VIM environment variable is not set, Vim will try to find the path in another way (see |$VIMRUNTIME|). Usually this works just fine. If it doesn't, try setting the VIM environment variable to the directory where the Vim stuff is located. For example, if your syntax files -are in the "/usr/vim/vim50/syntax" directory, set $VIMRUNTIME to -"/usr/vim/vim50". You must do this in the shell, before starting Vim. +are in the "/usr/vim/vim81/syntax" directory, set $VIMRUNTIME to +"/usr/vim/vim81". You must do this in the shell, before starting Vim. This command also sources the |menu.vim| script when the GUI is running or will start soon. See |'go-M'| about avoiding that. diff --git a/runtime/indent/testdir/yaml.in b/runtime/indent/testdir/yaml.in new file mode 100644 index 0000000000..e3d77e2543 --- /dev/null +++ b/runtime/indent/testdir/yaml.in @@ -0,0 +1,14 @@ +# vim: set ft=yaml sw=2 et : + +# START_INDENT +map1: +sub1: +- list item +map2: +- another list +# END_INDENT + +# START_INDENT +map: &anchor +map: val +# END_INDENT diff --git a/runtime/indent/testdir/yaml.ok b/runtime/indent/testdir/yaml.ok new file mode 100644 index 0000000000..b97b2e5896 --- /dev/null +++ b/runtime/indent/testdir/yaml.ok @@ -0,0 +1,14 @@ +# vim: set ft=yaml sw=2 et : + +# START_INDENT +map1: + sub1: + - list item +map2: + - another list +# END_INDENT + +# START_INDENT +map: &anchor +map: val +# END_INDENT diff --git a/runtime/indent/yaml.vim b/runtime/indent/yaml.vim index 3eb16f845d..9621b2b6ed 100644 --- a/runtime/indent/yaml.vim +++ b/runtime/indent/yaml.vim @@ -1,7 +1,7 @@ " Vim indent file " Language: YAML " Maintainer: Nikolai Pavlov -" Last Change: 2017 Jun 13 +" Last Change: 2019 Sep 28 " Only load this indent file when no other was loaded. if exists('b:did_indent') @@ -29,7 +29,7 @@ function s:FindPrevLessIndentedLine(lnum, ...) let curindent = a:0 ? a:1 : indent(a:lnum) while prevlnum \&& indent(prevlnum) >= curindent - \&& getline(prevlnum) =~# '^\s*#' + \&& getline(prevlnum) !~# '^\s*#' let prevlnum = prevnonblank(prevlnum-1) endwhile return prevlnum diff --git a/runtime/syntax/named.vim b/runtime/syntax/named.vim index 210d387ece..292d1b2bbf 100644 --- a/runtime/syntax/named.vim +++ b/runtime/syntax/named.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: BIND configuration file " Maintainer: Nick Hibma -" Last Change: 2007-01-30 +" Last Change: 2019 Oct 08 " Filenames: named.conf, rndc.conf " Location: http://www.van-laarhoven.org/vim/syntax/named.vim " @@ -54,7 +54,7 @@ syn match namedIntIdent contained /"\=\k\+"\=/ nextgroup=namedIntSection skipwhi syn region namedSection contained start=+{+ end=+};+ contains=namedSection,namedIntKeyword " --- IntSection: section that does not contain other sections -syn region namedIntSection contained start=+{+ end=+}+ contains=namedIntKeyword,namedError +syn region namedIntSection contained start=+{+ end=+}+ contains=namedIntKeyword,namedError,namedComment " --- IntKeyword: keywords contained within `{ ... }' sections only " + these keywords are contained within `key' and `acl' sections