diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-03-01 19:06:45 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-03-01 19:06:45 +0100 |
commit | eab6dff19f387469a200011bc6cf3508f5e43a4a (patch) | |
tree | ca478c342a695a07cfb7234324cecf2b714ec7b1 /runtime | |
parent | f51cb4e08ef904d137c27fe7cddb4702d8dcb2a2 (diff) |
Update runtime files
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/autoload/xmlformat.vim | 65 | ||||
-rw-r--r-- | runtime/doc/cmdline.txt | 6 | ||||
-rw-r--r-- | runtime/doc/helphelp.txt | 13 | ||||
-rw-r--r-- | runtime/doc/syntax.txt | 8 | ||||
-rw-r--r-- | runtime/doc/tags | 2 | ||||
-rw-r--r-- | runtime/doc/todo.txt | 11 | ||||
-rw-r--r-- | runtime/doc/usr_03.txt | 5 | ||||
-rw-r--r-- | runtime/doc/vim9.txt | 2 | ||||
-rw-r--r-- | runtime/pack/dist/opt/matchit/autoload/matchit.vim | 4 | ||||
-rw-r--r-- | runtime/pack/dist/opt/matchit/doc/matchit.txt | 2 | ||||
-rw-r--r-- | runtime/pack/dist/opt/matchit/plugin/matchit.vim | 2 |
11 files changed, 78 insertions, 42 deletions
diff --git a/runtime/autoload/xmlformat.vim b/runtime/autoload/xmlformat.vim index 30b09f1261..c89c8784b9 100644 --- a/runtime/autoload/xmlformat.vim +++ b/runtime/autoload/xmlformat.vim @@ -1,6 +1,6 @@ " Vim plugin for formatting XML -" Last Change: 2019 Oct 24 -" Version: 0.2 +" Last Change: 2020 Jan 06 +" Version: 0.3 " Author: Christian Brabandt <cb@256bit.org> " Repository: https://github.com/chrisbra/vim-xml-ftplugin " License: VIM License @@ -15,7 +15,7 @@ let s:keepcpo = &cpo set cpo&vim " Main function: Format the input {{{1 -func! xmlformat#Format() +func! xmlformat#Format() abort " only allow reformatting through the gq command " (e.g. Vim is in normal mode) if mode() != 'n' @@ -40,14 +40,16 @@ func! xmlformat#Format() continue elseif line !~# '<[/]\?[^>]*>' let nextmatch = match(list, '<[/]\?[^>]*>', current) - let line .= join(list[(current + 1):(nextmatch-1)], "\n") - call remove(list, current+1, nextmatch-1) + if nextmatch > -1 + let line .= ' '. join(list[(current + 1):(nextmatch-1)], " ") + call remove(list, current+1, nextmatch-1) + endif endif " split on `>`, but don't split on very first opening < " this means, items can be like ['<tag>', 'tag content</tag>'] for item in split(line, '.\@<=[>]\zs') if s:EndTag(item) - let s:indent = s:DecreaseIndent() + call s:DecreaseIndent() call add(result, s:Indent(item)) elseif s:EmptyTag(lastitem) call add(result, s:Indent(item)) @@ -59,13 +61,23 @@ func! xmlformat#Format() " Simply split on '<', if there is one, " but reformat according to &textwidth let t=split(item, '.<\@=\zs') + + " if the content fits well within a single line, add it there + " so that the output looks like this: + " + " <foobar>1</foobar> + if s:TagContent(lastitem) is# s:TagContent(t[1]) && strlen(result[-1]) + strlen(item) <= s:Textwidth() + let result[-1] .= item + let lastitem = t[1] + continue + endif " t should only contain 2 items, but just be safe here if s:IsTag(lastitem) let s:indent+=1 endif let result+=s:FormatContent([t[0]]) if s:EndTag(t[1]) - let s:indent = s:DecreaseIndent() + call s:DecreaseIndent() endif "for y in t[1:] let result+=s:FormatContent(t[1:]) @@ -97,15 +109,15 @@ func! xmlformat#Format() return 0 endfunc " Check if given tag is XML Declaration header {{{1 -func! s:IsXMLDecl(tag) +func! s:IsXMLDecl(tag) abort return a:tag =~? '^\s*<?xml\s\?\%(version="[^"]*"\)\?\s\?\%(encoding="[^"]*"\)\? ?>\s*$' endfunc " Return tag indented by current level {{{1 -func! s:Indent(item) +func! s:Indent(item) abort return repeat(' ', shiftwidth()*s:indent). s:Trim(a:item) endfu " Return item trimmed from leading whitespace {{{1 -func! s:Trim(item) +func! s:Trim(item) abort if exists('*trim') return trim(a:item) else @@ -113,44 +125,53 @@ func! s:Trim(item) endif endfunc " Check if tag is a new opening tag <tag> {{{1 -func! s:StartTag(tag) +func! s:StartTag(tag) abort let is_comment = s:IsComment(a:tag) return a:tag =~? '^\s*<[^/?]' && !is_comment endfunc " Check if tag is a Comment start {{{1 -func! s:IsComment(tag) +func! s:IsComment(tag) abort return a:tag =~? '<!--' endfunc " Remove one level of indentation {{{1 -func! s:DecreaseIndent() - return (s:indent > 0 ? s:indent - 1 : 0) +func! s:DecreaseIndent() abort + let s:indent = (s:indent > 0 ? s:indent - 1 : 0) endfunc " Check if tag is a closing tag </tag> {{{1 -func! s:EndTag(tag) +func! s:EndTag(tag) abort return a:tag =~? '^\s*</' endfunc " Check that the tag is actually a tag and not {{{1 " something like "foobar</foobar>" -func! s:IsTag(tag) +func! s:IsTag(tag) abort return s:Trim(a:tag)[0] == '<' endfunc " Check if tag is empty <tag/> {{{1 -func! s:EmptyTag(tag) +func! s:EmptyTag(tag) abort return a:tag =~ '/>\s*$' endfunc +func! s:TagContent(tag) abort "{{{1 + " Return content of a tag + return substitute(a:tag, '^\s*<[/]\?\([^>]*\)>\s*$', '\1', '') +endfunc +func! s:Textwidth() abort "{{{1 + " return textwidth (or 80 if not set) + return &textwidth == 0 ? 80 : &textwidth +endfunc " Format input line according to textwidth {{{1 -func! s:FormatContent(list) +func! s:FormatContent(list) abort let result=[] - let limit = 80 - if &textwidth > 0 - let limit = &textwidth - endif + let limit = s:Textwidth() let column=0 let idx = -1 let add_indent = 0 let cnt = 0 for item in a:list for word in split(item, '\s\+\S\+\zs') + if match(word, '^\s\+$') > -1 + " skip empty words + continue + endif let column += strdisplaywidth(word, column) if match(word, "^\\s*\n\\+\\s*$") > -1 call add(result, '') diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt index 6bd508172a..a01d4b97f1 100644 --- a/runtime/doc/cmdline.txt +++ b/runtime/doc/cmdline.txt @@ -1,4 +1,4 @@ -*cmdline.txt* For Vim version 8.2. Last change: 2020 Feb 15 +*cmdline.txt* For Vim version 8.2. Last change: 2020 Feb 29 VIM REFERENCE MANUAL by Bram Moolenaar @@ -476,6 +476,10 @@ emulate it. For example, this mimics autolist=ambiguous: This will find the longest match with the first 'wildchar', then list all matching files with the next. + *complete-script-local-functions* +When completing user function names, prepend "s:" to find script-local +functions. + *suffixes* For file name completion you can use the 'suffixes' option to set a priority between files with almost the same name. If there are multiple matches, diff --git a/runtime/doc/helphelp.txt b/runtime/doc/helphelp.txt index d99d451014..7771a505ba 100644 --- a/runtime/doc/helphelp.txt +++ b/runtime/doc/helphelp.txt @@ -1,4 +1,4 @@ -*helphelp.txt* For Vim version 8.2. Last change: 2019 Oct 18 +*helphelp.txt* For Vim version 8.2. Last change: 2020 Mar 01 VIM REFERENCE MANUAL by Bram Moolenaar @@ -368,4 +368,15 @@ highlighting. So do these: You can find the details in $VIMRUNTIME/syntax/help.vim + *inclusion* +Some people make a big deal about using "his" when referring to the user, +thinking it means we assume the user is male. That is of course not the case, +it's just a habit of writing help text, which quite often is many years old. +Also, a lot of the text is written by contributors for who English is not +their first language. We do not make any assumptions about the gender of the +user, no matter how the text is phrased. And we do not want to waste time on +this discussion. The goal is that the reader understands how Vim works, the +exact wording is secondary. + + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index 28b328b4df..686c98adfb 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -1,4 +1,4 @@ -*syntax.txt* For Vim version 8.2. Last change: 2019 Dec 19 +*syntax.txt* For Vim version 8.2. Last change: 2020 Feb 29 VIM REFERENCE MANUAL by Bram Moolenaar @@ -217,7 +217,7 @@ The name for a highlight or syntax group must consist of ASCII letters, digits and the underscore. As a regexp: "[a-zA-Z0-9_]*". However, Vim does not give an error when using other characters. -To be able to allow each user to pick his favorite set of colors, there must +To be able to allow each user to pick their favorite set of colors, there must be preferred names for highlight groups that are common for many languages. These are the suggested group names (if syntax highlighting works properly you can see the actual color, except for "Ignore"): @@ -4512,8 +4512,8 @@ two different ways: (e.g., "syntax/pod.vim") the file is searched for in 'runtimepath'. All matching files are loaded. Using a relative path is recommended, because it allows a user to replace the included file - with his own version, without replacing the file that does the ":syn - include". + with their own version, without replacing the file that does the + ":syn include". *E847* The maximum number of includes is 999. diff --git a/runtime/doc/tags b/runtime/doc/tags index fdba199a04..3ba0ccc222 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -5823,6 +5823,7 @@ complete-item-kind insert.txt /*complete-item-kind* complete-items insert.txt /*complete-items* complete-popup insert.txt /*complete-popup* complete-popuphidden insert.txt /*complete-popuphidden* +complete-script-local-functions cmdline.txt /*complete-script-local-functions* complete_CTRL-E insert.txt /*complete_CTRL-E* complete_CTRL-Y insert.txt /*complete_CTRL-Y* complete_add() eval.txt /*complete_add()* @@ -7371,6 +7372,7 @@ in_name channel.txt /*in_name* in_top channel.txt /*in_top* inactive-buffer windows.txt /*inactive-buffer* include-search tagsrch.txt /*include-search* +inclusion helphelp.txt /*inclusion* inclusive motion.txt /*inclusive* incomp-small-6 version6.txt /*incomp-small-6* incompatible-5 version5.txt /*incompatible-5* diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index aff7bf05c0..60ba4bd82c 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1,4 +1,4 @@ -*todo.txt* For Vim version 8.2. Last change: 2020 Feb 25 +*todo.txt* For Vim version 8.2. Last change: 2020 Mar 01 VIM REFERENCE MANUAL by Bram Moolenaar @@ -38,13 +38,9 @@ browser use: https://github.com/vim/vim/issues/1234 *known-bugs* -------------------- Known bugs and current work ----------------------- -Patch for this (#5696): -- Empty text prop which includes start/end does not grow when inserting text. - (Axel Forsman, #5679) - Vim9 script: +- better implementation for partial and tests. - "func" inside "vim9script" doesn't work? (Ben Jackson, #5670) -- Completion for :disassemble - "echo Func()" is an error if Func() does not return anything. - Make "g:imported = Export.exported" work in Vim9 script. - Make Foo.Bar() work to call the dict function. (#5676) @@ -193,8 +189,6 @@ Flag in 'formatoptions' is not used in the tests. Patch to add 'vtp' option. (#5344) Needs better docs. Is there a better name? -Patch for Haiku support. (Emir Sarı, #5605) - undo result wrong: Masato Nishihata, #4798 When 'lazyredraw' is set sometimes the title is not updated. @@ -204,6 +198,7 @@ Strange sequence of BufWipeout and BufNew events while doing omni-complete. (Paul Jolly, #5656) Get BufDelete without preceding BufNew. (Paul Jolly, #5694) BufWinenter event not fired when saving unnamed buffer. (Paul Jolly, #5655) +Another spurious BufDelete. (Dani Dickstein, #5701) Patch to add function to return the text used in the quickfix window. (Yegappan, #5465) diff --git a/runtime/doc/usr_03.txt b/runtime/doc/usr_03.txt index c0250887ee..38b36dde17 100644 --- a/runtime/doc/usr_03.txt +++ b/runtime/doc/usr_03.txt @@ -1,4 +1,4 @@ -*usr_03.txt* For Vim version 8.2. Last change: 2019 Nov 21 +*usr_03.txt* For Vim version 8.2. Last change: 2020 Feb 29 VIM USER MANUAL - by Bram Moolenaar @@ -346,7 +346,8 @@ to find the first #include after the cursor: > And then type "n" several times. You will move to each #include in the text. You can also use a count if you know which match you want. Thus "3n" finds -the third match. Using a count with "/" doesn't work. +the third match. You can also use a count with "/": "4/the" goes to the +fourth match of "the". The "?" command works like "/" but searches backwards: > diff --git a/runtime/doc/vim9.txt b/runtime/doc/vim9.txt index 3ba92dbcaf..b79ed69534 100644 --- a/runtime/doc/vim9.txt +++ b/runtime/doc/vim9.txt @@ -1,4 +1,4 @@ -*vim9.txt* For Vim version 8.2. Last change: 2020 Feb 22 +*vim9.txt* For Vim version 8.2. Last change: 2020 Feb 29 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/pack/dist/opt/matchit/autoload/matchit.vim b/runtime/pack/dist/opt/matchit/autoload/matchit.vim index f56e9e223d..4f3dd8ff9e 100644 --- a/runtime/pack/dist/opt/matchit/autoload/matchit.vim +++ b/runtime/pack/dist/opt/matchit/autoload/matchit.vim @@ -1,6 +1,6 @@ " matchit.vim: (global plugin) Extended "%" matching " autload script of matchit plugin, see ../plugin/matchit.vim -" Last Change: 2019 Oct 24 +" Last Change: Mar 01, 2020 let s:last_mps = "" let s:last_words = ":" @@ -48,6 +48,8 @@ function matchit#Match_wrapper(word, forward, mode) range execute "normal! gv\<Esc>" elseif a:mode == "o" && mode(1) !~# '[vV]' exe "norm! v" + elseif a:mode == "n" && mode(1) =~# 'ni' + exe "norm! v" endif " In s:CleanUp(), we may need to check whether the cursor moved forward. let startpos = [line("."), col(".")] diff --git a/runtime/pack/dist/opt/matchit/doc/matchit.txt b/runtime/pack/dist/opt/matchit/doc/matchit.txt index 689278a902..f2c51e10b2 100644 --- a/runtime/pack/dist/opt/matchit/doc/matchit.txt +++ b/runtime/pack/dist/opt/matchit/doc/matchit.txt @@ -4,7 +4,7 @@ For instructions on installing this file, type `:help matchit-install` inside Vim. -For Vim version 8.1. Last change: 2019 Oct 24 +For Vim version 8.1. Last change: 2020 Mar 01 VIM REFERENCE MANUAL by Benji Fisher et al diff --git a/runtime/pack/dist/opt/matchit/plugin/matchit.vim b/runtime/pack/dist/opt/matchit/plugin/matchit.vim index 4d0f4e014a..b62cc3913a 100644 --- a/runtime/pack/dist/opt/matchit/plugin/matchit.vim +++ b/runtime/pack/dist/opt/matchit/plugin/matchit.vim @@ -1,6 +1,6 @@ " matchit.vim: (global plugin) Extended "%" matching " Maintainer: Christian Brabandt -" Version: 1.16 +" Version: 1.17 " Last Change: 2019 Oct 24 " Repository: https://github.com/chrisbra/matchit " Previous URL:http://www.vim.org/script.php?script_id=39 |