diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-08-01 22:53:23 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-08-01 22:58:20 +0200 |
commit | 4d830ca31bd4346bd2cced48f056414162fa00a3 (patch) | |
tree | c83a6a77b5b2b70022036e023cc57e947db82eee | |
parent | 7f5402899b0ed4c47296836cade782342425340e (diff) | |
download | rneovim-4d830ca31bd4346bd2cced48f056414162fa00a3.tar.gz rneovim-4d830ca31bd4346bd2cced48f056414162fa00a3.tar.bz2 rneovim-4d830ca31bd4346bd2cced48f056414162fa00a3.zip |
vim-patch:62e1bb4a111e
Update runtime files.
https://github.com/vim/vim/commit/62e1bb4a111e7ce570c30965f40a68a07a9da5b0
NA: vim-patch:496555fd1821
-rw-r--r-- | runtime/doc/eval.txt | 15 | ||||
-rw-r--r-- | runtime/doc/index.txt | 3 | ||||
-rw-r--r-- | runtime/doc/message.txt | 6 | ||||
-rw-r--r-- | runtime/doc/usr_41.txt | 1 | ||||
-rw-r--r-- | runtime/indent/sh.vim | 50 | ||||
-rw-r--r-- | runtime/syntax/html.vim | 82 |
6 files changed, 106 insertions, 51 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 2af955b8c2..57ef380cc5 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -2245,6 +2245,7 @@ py3eval({expr}) any evaluate |python3| expression pyxeval({expr}) any evaluate |python_x| expression range({expr} [, {max} [, {stride}]]) List items from {expr} to {max} +readdir({dir} [, {expr}]) List file names in {dir} selected by {expr} readfile({fname} [, {binary} [, {max}]]) List get list of lines from file {fname} reg_executing() Number get the executing register name @@ -4769,6 +4770,9 @@ glob({expr} [, {nosuf} [, {list} [, {alllinks}]]]) *glob()* If the expansion fails, the result is an empty String or List. + You can also use |readdir()| if you need to do complicated + things, such as limiting the number of matches. + A name for a non-existing file is not included. A symbolic link is only included if it points to an existing file. However, when the {alllinks} argument is present and it is @@ -6473,6 +6477,17 @@ readfile({fname} [, {binary} [, {max}]]) the result is an empty list. Also see |writefile()|. + *readdir()* +readdir({directory} [, {expr}]) + Return a list with file and directory names in {directory}. + You can also use |glob()| if you don't need to do complicated + things, such as limiting the number of matches. + + When {expr} is omitted all entries are included. + When {expr} is given, it is evaluated to check what to do: + If {expr} results in -1 then no further entries will + be handled. + reg_executing() *reg_executing()* Returns the single letter name of the register being executed. Returns an empty string when no register is being executed. diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt index 4cab36a3c8..da48f7f84d 100644 --- a/runtime/doc/index.txt +++ b/runtime/doc/index.txt @@ -1496,7 +1496,8 @@ tag command action ~ |:sbrewind| :sbr[ewind] split window and go to first file in the buffer list |:scriptnames| :scr[iptnames] list names of all sourced Vim scripts -|:scriptencoding| :scripte[ncoding] encoding used in sourced Vim script +|:scriptencoding| :scripte[ncoding] encoding used in sourced Vim script +|:scriptversion| :scriptv[ersion] version of Vim script used |:scscope| :scs[cope] split window and execute cscope command |:set| :se[t] show or set options |:setfiletype| :setf[iletype] set 'filetype', unless it was set already diff --git a/runtime/doc/message.txt b/runtime/doc/message.txt index dccf39b3df..864eea8f7f 100644 --- a/runtime/doc/message.txt +++ b/runtime/doc/message.txt @@ -670,11 +670,13 @@ being disabled. Remove the 'C' flag from the 'cpoptions' option to enable it. This happens when an Ex command with mandatory argument(s) was executed, but no argument has been specified. - *E474* *E475* > + *E474* *E475* *E983* > Invalid argument Invalid argument: {arg} + Duplicate argument: {arg} -An Ex command has been executed, but an invalid argument has been specified. +An Ex command or function has been executed, but an invalid argument has been +specified. *E488* > Trailing characters diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt index 2c38c6fef2..a80ab963b1 100644 --- a/runtime/doc/usr_41.txt +++ b/runtime/doc/usr_41.txt @@ -770,6 +770,7 @@ System functions and manipulation of files: systemlist() get the result of a shell command as a list hostname() name of the system readfile() read a file into a List of lines + readdir() get a List of file names in a directory writefile() write a List of lines or Blob into a file Date and Time: *date-functions* *time-functions* diff --git a/runtime/indent/sh.vim b/runtime/indent/sh.vim index 32bc9f35bb..520d3eece1 100644 --- a/runtime/indent/sh.vim +++ b/runtime/indent/sh.vim @@ -3,10 +3,17 @@ " Maintainer: Christian Brabandt <cb@256bit.org> " Original Author: Nikolai Weibull <now@bitwi.se> " Previous Maintainer: Peter Aronoff <telemachus@arpinum.org> -" Latest Revision: 2018-03-26 +" Latest Revision: 2019-03-25 " License: Vim (see :h license) " Repository: https://github.com/chrisbra/vim-sh-indent " Changelog: +" 20190325 - Indent fi; correctly +" https://github.com/chrisbra/vim-sh-indent/issues/14 +" 20190319 - Indent arrays (only zsh and bash) +" https://github.com/chrisbra/vim-sh-indent/issues/13 +" 20190316 - Make use of searchpairpos for nested if sections +" fixes https://github.com/chrisbra/vim-sh-indent/issues/11 +" 20190201 - Better check for closing if sections " 20180724 - make check for zsh syntax more rigid (needs word-boundaries) " 20180326 - better support for line continuation " 20180325 - better detection of function definitions @@ -59,6 +66,7 @@ function! s:indent_value(option) endfunction function! GetShIndent() + let curline = getline(v:lnum) let lnum = prevnonblank(v:lnum - 1) if lnum == 0 return 0 @@ -72,7 +80,7 @@ function! GetShIndent() " Check contents of previous lines if line =~ '^\s*\%(if\|then\|do\|else\|elif\|case\|while\|until\|for\|select\|foreach\)\>' || \ (&ft is# 'zsh' && line =~ '\<\%(if\|then\|do\|else\|elif\|case\|while\|until\|for\|select\|foreach\)\>') - if line !~ '\<\%(fi\|esac\|done\|end\)\>\s*\%(#.*\)\=$' + if !s:is_end_expression(line) let ind += s:indent_value('default') endif elseif s:is_case_label(line, pnum) @@ -84,13 +92,22 @@ function! GetShIndent() if line !~ '}\s*\%(#.*\)\=$' let ind += s:indent_value('default') endif + " array (only works for zsh or bash) + elseif s:is_array(line) && line !~ ')\s*$' && (&ft is# 'zsh' || s:is_bash()) + let ind += s:indent_value('continuation-line') + " end of array + elseif curline =~ '^\s*)$' + let ind -= s:indent_value('continuation-line') elseif s:is_continuation_line(line) if pnum == 0 || !s:is_continuation_line(pline) let ind += s:indent_value('continuation-line') endif elseif s:end_block(line) && !s:start_block(line) let ind -= s:indent_value('default') - elseif pnum != 0 && s:is_continuation_line(pline) && !s:end_block(getline(v:lnum)) + elseif pnum != 0 && + \ s:is_continuation_line(pline) && + \ !s:end_block(curline) && + \ !s:is_end_expression(curline) " only add indent, if line and pline is in the same block let i = v:lnum let ind2 = indent(s:find_continued_lnum(pnum)) @@ -106,8 +123,15 @@ function! GetShIndent() let pine = line " Check content of current line - let line = getline(v:lnum) - if line =~ '^\s*\%(then\|do\|else\|elif\|fi\|done\|end\)\>' || s:end_block(line) + let line = curline + " Current line is a endif line, so get indent from start of "if condition" line + " TODO: should we do the same for other "end" lines? + if curline =~ '^\s*\%(fi\);\?\s*\%(#.*\)\=$' + let previous_line = searchpair('\<if\>', '', '\<fi\>', 'bnW') + if previous_line > 0 + let ind = indent(previous_line) + endif + elseif line =~ '^\s*\%(then\|do\|else\|elif\|done\|end\)\>' || s:end_block(line) let ind -= s:indent_value('default') elseif line =~ '^\s*esac\>' && s:is_case_empty(getline(v:lnum - 1)) let ind -= s:indent_value('default') @@ -167,6 +191,10 @@ function! s:is_function_definition(line) \ a:line =~ '^\s*function\s*\w\S\+\s*\%(()\)\?\s*{' endfunction +function! s:is_array(line) + return a:line =~ '^\s*\<\k\+\>=(' +endfunction + function! s:is_case_label(line, pnum) if a:line !~ '^\s*(\=.*)' return 0 @@ -210,8 +238,8 @@ endfunction function! s:is_here_doc(line) if a:line =~ '^\w\+$' - let here_pat = '<<-\?'. s:escape(a:line). '\$' - return search(here_pat, 'bnW') > 0 + let here_pat = '<<-\?'. s:escape(a:line). '\$' + return search(here_pat, 'bnW') > 0 endif return 0 endfunction @@ -256,5 +284,13 @@ function! s:is_comment(line) return a:line =~ '^\s*#' endfunction +function! s:is_end_expression(line) + return a:line =~ '\<\%(fi\|esac\|done\|end\)\>\s*\%(#.*\)\=$' +endfunction + +function! s:is_bash() + return get(g:, 'is_bash', 0) || get(b:, 'is_bash', 0) +endfunction + let &cpo = s:cpo_save unlet s:cpo_save diff --git a/runtime/syntax/html.vim b/runtime/syntax/html.vim index cde5269d02..d16ee1817f 100644 --- a/runtime/syntax/html.vim +++ b/runtime/syntax/html.vim @@ -3,8 +3,8 @@ " Maintainer: Jorge Maldonado Ventura <jorgesumle@freakspot.net> " Previous Maintainer: Claudio Fleiner <claudio@fleiner.com> " Repository: https://notabug.org/jorgesumle/vim-html-syntax -" Last Change: 2018 May 31 -" Included patch from Jay Sitter to add WAI-ARIA htmlArg keywords +" Last Change: 2018 Apr 7 +" Included patch from Jorge Maldonado Ventura to fix rendering " " Please check :help html.vim for some comments and a description of the options @@ -159,47 +159,47 @@ if !exists("html_no_rendering") " rendering syn cluster htmlTop contains=@Spell,htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLink,javaScript,@htmlPreproc - syn region htmlStrike start="<del\>" end="</del>"me=e-6 contains=@htmlTop - syn region htmlStrike start="<strike\>" end="</strike>"me=e-9 contains=@htmlTop - - syn region htmlBold start="<b\>" end="</b>"me=e-4 contains=@htmlTop,htmlBoldUnderline,htmlBoldItalic - syn region htmlBold start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop,htmlBoldUnderline,htmlBoldItalic - syn region htmlBoldUnderline contained start="<u\>" end="</u>"me=e-4 contains=@htmlTop,htmlBoldUnderlineItalic - syn region htmlBoldItalic contained start="<i\>" end="</i>"me=e-4 contains=@htmlTop,htmlBoldItalicUnderline - syn region htmlBoldItalic contained start="<em\>" end="</em>"me=e-5 contains=@htmlTop,htmlBoldItalicUnderline - syn region htmlBoldUnderlineItalic contained start="<i\>" end="</i>"me=e-4 contains=@htmlTop - syn region htmlBoldUnderlineItalic contained start="<em\>" end="</em>"me=e-5 contains=@htmlTop - syn region htmlBoldItalicUnderline contained start="<u\>" end="</u>"me=e-4 contains=@htmlTop,htmlBoldUnderlineItalic - - syn region htmlUnderline start="<u\>" end="</u>"me=e-4 contains=@htmlTop,htmlUnderlineBold,htmlUnderlineItalic - syn region htmlUnderlineBold contained start="<b\>" end="</b>"me=e-4 contains=@htmlTop,htmlUnderlineBoldItalic - syn region htmlUnderlineBold contained start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop,htmlUnderlineBoldItalic - syn region htmlUnderlineItalic contained start="<i\>" end="</i>"me=e-4 contains=@htmlTop,htmlUnderlineItalicBold - syn region htmlUnderlineItalic contained start="<em\>" end="</em>"me=e-5 contains=@htmlTop,htmlUnderlineItalicBold - syn region htmlUnderlineItalicBold contained start="<b\>" end="</b>"me=e-4 contains=@htmlTop - syn region htmlUnderlineItalicBold contained start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop - syn region htmlUnderlineBoldItalic contained start="<i\>" end="</i>"me=e-4 contains=@htmlTop - syn region htmlUnderlineBoldItalic contained start="<em\>" end="</em>"me=e-5 contains=@htmlTop - - syn region htmlItalic start="<i\>" end="</i>"me=e-4 contains=@htmlTop,htmlItalicBold,htmlItalicUnderline - syn region htmlItalic start="<em\>" end="</em>"me=e-5 contains=@htmlTop - syn region htmlItalicBold contained start="<b\>" end="</b>"me=e-4 contains=@htmlTop,htmlItalicBoldUnderline - syn region htmlItalicBold contained start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop,htmlItalicBoldUnderline - syn region htmlItalicBoldUnderline contained start="<u\>" end="</u>"me=e-4 contains=@htmlTop - syn region htmlItalicUnderline contained start="<u\>" end="</u>"me=e-4 contains=@htmlTop,htmlItalicUnderlineBold - syn region htmlItalicUnderlineBold contained start="<b\>" end="</b>"me=e-4 contains=@htmlTop - syn region htmlItalicUnderlineBold contained start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop + syn region htmlStrike start="<del\>" end="</del\_s*>"me=s-1 contains=@htmlTop + syn region htmlStrike start="<strike\>" end="</strike\_s*>"me=s-1 contains=@htmlTop + + syn region htmlBold start="<b\>" end="</b\_s*>"me=s-1 contains=@htmlTop,htmlBoldUnderline,htmlBoldItalic + syn region htmlBold start="<strong\>" end="</strong\_s*>"me=s-1 contains=@htmlTop,htmlBoldUnderline,htmlBoldItalic + syn region htmlBoldUnderline contained start="<u\>" end="</u\_s*>"me=s-1 contains=@htmlTop,htmlBoldUnderlineItalic + syn region htmlBoldItalic contained start="<i\>" end="</i\_s*>"me=s-1 contains=@htmlTop,htmlBoldItalicUnderline + syn region htmlBoldItalic contained start="<em\>" end="</em\_s*>"me=s-1 contains=@htmlTop,htmlBoldItalicUnderline + syn region htmlBoldUnderlineItalic contained start="<i\>" end="</i\_s*>"me=s-1 contains=@htmlTop + syn region htmlBoldUnderlineItalic contained start="<em\>" end="</em\_s*>"me=s-1 contains=@htmlTop + syn region htmlBoldItalicUnderline contained start="<u\>" end="</u\_s*>"me=s-1 contains=@htmlTop,htmlBoldUnderlineItalic + + syn region htmlUnderline start="<u\>" end="</u\_s*>"me=s-1 contains=@htmlTop,htmlUnderlineBold,htmlUnderlineItalic + syn region htmlUnderlineBold contained start="<b\>" end="</b\_s*>"me=s-1 contains=@htmlTop,htmlUnderlineBoldItalic + syn region htmlUnderlineBold contained start="<strong\>" end="</strong\_s*>"me=s-1 contains=@htmlTop,htmlUnderlineBoldItalic + syn region htmlUnderlineItalic contained start="<i\>" end="</i\_s*>"me=s-1 contains=@htmlTop,htmlUnderlineItalicBold + syn region htmlUnderlineItalic contained start="<em\>" end="</em\_s*>"me=s-1 contains=@htmlTop,htmlUnderlineItalicBold + syn region htmlUnderlineItalicBold contained start="<b\>" end="</b\_s*>"me=s-1 contains=@htmlTop + syn region htmlUnderlineItalicBold contained start="<strong\>" end="</strong\_s*>"me=s-1 contains=@htmlTop + syn region htmlUnderlineBoldItalic contained start="<i\>" end="</i\_s*>"me=s-1 contains=@htmlTop + syn region htmlUnderlineBoldItalic contained start="<em\>" end="</em\_s*>"me=s-1 contains=@htmlTop + + syn region htmlItalic start="<i\>" end="</i\_s*>"me=s-1 contains=@htmlTop,htmlItalicBold,htmlItalicUnderline + syn region htmlItalic start="<em\>" end="</em\_s*>"me=s-1 contains=@htmlTop + syn region htmlItalicBold contained start="<b\>" end="</b\_s*>"me=s-1 contains=@htmlTop,htmlItalicBoldUnderline + syn region htmlItalicBold contained start="<strong\>" end="</strong\_s*>"me=s-1 contains=@htmlTop,htmlItalicBoldUnderline + syn region htmlItalicBoldUnderline contained start="<u\>" end="</u\_s*>"me=s-1 contains=@htmlTop + syn region htmlItalicUnderline contained start="<u\>" end="</u\_s*>"me=s-1 contains=@htmlTop,htmlItalicUnderlineBold + syn region htmlItalicUnderlineBold contained start="<b\>" end="</b\_s*>"me=s-1 contains=@htmlTop + syn region htmlItalicUnderlineBold contained start="<strong\>" end="</strong\_s*>"me=s-1 contains=@htmlTop syn match htmlLeadingSpace "^\s\+" contained - syn region htmlLink start="<a\>\_[^>]*\<href\>" end="</a>"me=e-4 contains=@Spell,htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLeadingSpace,javaScript,@htmlPreproc - syn region htmlH1 start="<h1\>" end="</h1>"me=e-5 contains=@htmlTop - syn region htmlH2 start="<h2\>" end="</h2>"me=e-5 contains=@htmlTop - syn region htmlH3 start="<h3\>" end="</h3>"me=e-5 contains=@htmlTop - syn region htmlH4 start="<h4\>" end="</h4>"me=e-5 contains=@htmlTop - syn region htmlH5 start="<h5\>" end="</h5>"me=e-5 contains=@htmlTop - syn region htmlH6 start="<h6\>" end="</h6>"me=e-5 contains=@htmlTop - syn region htmlHead start="<head\>" end="</head>"me=e-7 end="<body\>"me=e-5 end="<h[1-6]\>"me=e-3 contains=htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLink,htmlTitle,javaScript,cssStyle,@htmlPreproc - syn region htmlTitle start="<title\>" end="</title>"me=e-8 contains=htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,javaScript,@htmlPreproc + syn region htmlLink start="<a\>\_[^>]*\<href\>" end="</a\_s*>"me=s-1 contains=@Spell,htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLeadingSpace,javaScript,@htmlPreproc + syn region htmlH1 start="<h1\>" end="</h1\_s*>"me=s-1 contains=@htmlTop + syn region htmlH2 start="<h2\>" end="</h2\_s*>"me=s-1 contains=@htmlTop + syn region htmlH3 start="<h3\>" end="</h3\_s*>"me=s-1 contains=@htmlTop + syn region htmlH4 start="<h4\>" end="</h4\_s*>"me=s-1 contains=@htmlTop + syn region htmlH5 start="<h5\>" end="</h5\_s*>"me=s-1 contains=@htmlTop + syn region htmlH6 start="<h6\>" end="</h6\_s*>"me=s-1 contains=@htmlTop + syn region htmlHead start="<head\>" end="</head\_s*>"me=s-1 end="<body\>"me=s-1 end="<h[1-6]\>"me=s-1 contains=htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLink,htmlTitle,javaScript,cssStyle,@htmlPreproc + syn region htmlTitle start="<title\>" end="</title\_s*>"me=s-1 contains=htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,javaScript,@htmlPreproc endif syn keyword htmlTagName contained noscript |