diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-05-01 22:09:13 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-05-01 23:19:57 -0400 |
commit | dd2bc06411a69917c6f4a47d0b6832104efa98e4 (patch) | |
tree | 45224b63ba9c145f7cef7bb74a0081d467017eca | |
parent | c1dd4e83b494d19a5ebcb7ffb936cb4649f11637 (diff) | |
download | rneovim-dd2bc06411a69917c6f4a47d0b6832104efa98e4.tar.gz rneovim-dd2bc06411a69917c6f4a47d0b6832104efa98e4.tar.bz2 rneovim-dd2bc06411a69917c6f4a47d0b6832104efa98e4.zip |
vim-patch:82be4849eed0
Update runtime files.
https://github.com/vim/vim/commit/82be4849eed0b8fbee45bc8da99b685ec89af59a
-rw-r--r-- | runtime/doc/editing.txt | 2 | ||||
-rw-r--r-- | runtime/doc/pattern.txt | 5 | ||||
-rw-r--r-- | runtime/doc/usr_03.txt | 2 | ||||
-rw-r--r-- | runtime/doc/usr_41.txt | 6 | ||||
-rw-r--r-- | runtime/ftplugin/erlang.vim | 112 | ||||
-rw-r--r-- | runtime/ftplugin/fstab.vim | 4 | ||||
-rw-r--r-- | runtime/ftplugin/swift.vim | 11 | ||||
-rw-r--r-- | runtime/ftplugin/vim.vim | 20 | ||||
-rw-r--r-- | runtime/indent/systemverilog.vim | 2 | ||||
-rw-r--r-- | runtime/indent/testdir/vim.in | 19 | ||||
-rw-r--r-- | runtime/indent/testdir/vim.ok | 19 | ||||
-rw-r--r-- | runtime/indent/vim.vim | 46 | ||||
-rw-r--r-- | runtime/pack/dist/opt/termdebug/plugin/termdebug.vim | 2 | ||||
-rw-r--r-- | runtime/syntax/abap.vim | 4 | ||||
-rw-r--r-- | runtime/syntax/prolog.vim | 10 |
15 files changed, 178 insertions, 86 deletions
diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt index eddd341ace..ea1375ef3d 100644 --- a/runtime/doc/editing.txt +++ b/runtime/doc/editing.txt @@ -976,7 +976,7 @@ to write anyway add a '!' to the command. *write-permissions* When writing a new file the permissions are read-write. For unix the mask is -0666 with additionally umask applied. When writing a file that was read Vim +0o666 with additionally umask applied. When writing a file that was read Vim will preserve the permissions, but clear the s-bit. *write-readonly* diff --git a/runtime/doc/pattern.txt b/runtime/doc/pattern.txt index 86712cdfe1..8666a2310c 100644 --- a/runtime/doc/pattern.txt +++ b/runtime/doc/pattern.txt @@ -1168,7 +1168,7 @@ x A single character, with no special meaning, matches itself \b <BS> \n line break, see above |/[\n]| \d123 decimal number of character - \o40 octal number of character up to 0377 + \o40 octal number of character up to 0o377 \x20 hexadecimal number of character up to 0xff \u20AC hex. number of multibyte character up to 0xffff \U1234 hex. number of multibyte character up to 0xffffffff @@ -1205,7 +1205,8 @@ x A single character, with no special meaning, matches itself \%d123 Matches the character specified with a decimal number. Must be followed by a non-digit. \%o40 Matches the character specified with an octal number up to 0377. - Numbers below 040 must be followed by a non-octal digit or a non-digit. + Numbers below 0o40 must be followed by a non-octal digit or a + non-digit. \%x2a Matches the character specified with up to two hexadecimal characters. \%u20AC Matches the character specified with up to four hexadecimal characters. diff --git a/runtime/doc/usr_03.txt b/runtime/doc/usr_03.txt index d42701b698..74674fdb42 100644 --- a/runtime/doc/usr_03.txt +++ b/runtime/doc/usr_03.txt @@ -50,7 +50,7 @@ which moves to the previous end of a word: This is a line with example text ~ <----<----x---->------------> - 2ge ge e we + 2ge ge e 2e If you are at the last word of a line, the "w" command will take you to the first word in the next line. Thus you can use this to move through a diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt index 30f0cdfb62..081b3ece1c 100644 --- a/runtime/doc/usr_41.txt +++ b/runtime/doc/usr_41.txt @@ -122,14 +122,14 @@ starts with a zero. "017" is decimal 15. A binary number starts with "0b" or decimal number, it will be interpreted as an octal number! The ":echo" command always prints decimal numbers. Example: > - :echo 0x7f 036 + :echo 0x7f 0o36 < 127 30 ~ A number is made negative with a minus sign. This also works for hexadecimal, octal and binary numbers. A minus sign is also used for subtraction. Compare this with the previous example: > - :echo 0x7f -036 + :echo 0x7f -0o36 < 97 ~ White space in an expression is ignored. However, it's recommended to use it @@ -137,7 +137,7 @@ for separating items, to make the expression easier to read. For example, to avoid the confusion with a negative number above, put a space between the minus sign and the following number: > - :echo 0x7f - 036 + :echo 0x7f - 0o36 ============================================================================== *41.2* Variables diff --git a/runtime/ftplugin/erlang.vim b/runtime/ftplugin/erlang.vim index ece11d7249..c775247f51 100644 --- a/runtime/ftplugin/erlang.vim +++ b/runtime/ftplugin/erlang.vim @@ -1,87 +1,83 @@ " Vim ftplugin file -" Language: Erlang +" Language: Erlang (http://www.erlang.org) +" Maintainer: Csaba Hoch <csaba.hoch@gmail.com> " Author: Oscar Hellström <oscar@oscarh.net> " Contributors: Ricardo Catalinas Jiménez <jimenezrick@gmail.com> " Eduardo Lopez (http://github.com/tapichu) +" Arvid Bjurklint (http://github.com/slarwise) +" Last Update: 2021-Jan-08 " License: Vim license -" Version: 2012/01/25 +" URL: https://github.com/vim-erlang/vim-erlang-runtime if exists('b:did_ftplugin') - finish -else - let b:did_ftplugin = 1 -endif - -if exists('s:did_function_definitions') - call s:SetErlangOptions() - finish -else - let s:did_function_definitions = 1 + finish endif +let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim -if !exists('g:erlang_keywordprg') - let g:erlang_keywordprg = 'erl -man' -endif +let &l:keywordprg = get(g:, 'erlang_keywordprg', 'erl -man') -if !exists('g:erlang_folding') - let g:erlang_folding = 0 +if get(g:, 'erlang_folding', 0) + setlocal foldmethod=expr + setlocal foldexpr=GetErlangFold(v:lnum) + setlocal foldtext=ErlangFoldText() endif -let s:erlang_fun_begin = '^\a\w*(.*$' -let s:erlang_fun_end = '^[^%]*\.\s*\(%.*\)\?$' - -function s:SetErlangOptions() - if g:erlang_folding - setlocal foldmethod=expr - setlocal foldexpr=GetErlangFold(v:lnum) - setlocal foldtext=ErlangFoldText() - endif +setlocal comments=:%%%,:%%,:% +setlocal commentstring=%%s - setlocal comments=:%%%,:%%,:% - setlocal commentstring=%%s +setlocal formatoptions+=ro - setlocal formatoptions+=ro - let &l:keywordprg = g:erlang_keywordprg -endfunction +setlocal suffixesadd=.erl,.hrl -function GetErlangFold(lnum) - let lnum = a:lnum - let line = getline(lnum) +let &l:include = '^\s*-\%(include\|include_lib\)\s*("\zs\f*\ze")' +let &l:define = '^\s*-\%(define\|record\|type\|opaque\)' - if line =~ s:erlang_fun_end - return '<1' - endif +let s:erlang_fun_begin = '^\a\w*(.*$' +let s:erlang_fun_end = '^[^%]*\.\s*\(%.*\)\?$' - if line =~ s:erlang_fun_begin && foldlevel(lnum - 1) == 1 - return '1' - endif +if !exists('*GetErlangFold') + function GetErlangFold(lnum) + let lnum = a:lnum + let line = getline(lnum) - if line =~ s:erlang_fun_begin - return '>1' - endif + if line =~ s:erlang_fun_end + return '<1' + endif - return '=' -endfunction + if line =~ s:erlang_fun_begin && foldlevel(lnum - 1) == 1 + return '1' + endif -function ErlangFoldText() - let line = getline(v:foldstart) - let foldlen = v:foldend - v:foldstart + 1 - let lines = ' ' . foldlen . ' lines: ' . substitute(line, "[\ \t]*", '', '') - if foldlen < 10 - let lines = ' ' . lines - endif - let retval = '+' . v:folddashes . lines + if line =~ s:erlang_fun_begin + return '>1' + endif - return retval -endfunction + return '=' + endfunction +endif -call s:SetErlangOptions() +if !exists('*ErlangFoldText') + function ErlangFoldText() + let line = getline(v:foldstart) + let foldlen = v:foldend - v:foldstart + 1 + let lines = ' ' . foldlen . ' lines: ' . substitute(line, "[\ \t]*", '', '') + if foldlen < 10 + let lines = ' ' . lines + endif + let retval = '+' . v:folddashes . lines + + return retval + endfunction +endif -let b:undo_ftplugin = "setlocal foldmethod< foldexpr< foldtext<" - \ . " comments< commentstring< formatoptions<" +let b:undo_ftplugin = "setlocal keywordprg< foldmethod< foldexpr< foldtext<" + \ . " comments< commentstring< formatoptions< suffixesadd< include<" + \ . " define<" let &cpo = s:cpo_save unlet s:cpo_save + +" vim: sw=2 et diff --git a/runtime/ftplugin/fstab.vim b/runtime/ftplugin/fstab.vim index 3e7af9fb30..99805322cd 100644 --- a/runtime/ftplugin/fstab.vim +++ b/runtime/ftplugin/fstab.vim @@ -2,7 +2,7 @@ " Language: fstab file " Maintainer: Radu Dineiu <radu.dineiu@gmail.com> " URL: https://raw.github.com/rid9/vim-fstab/master/ftplugin/fstab.vim -" Last Change: 2020 Dec 29 +" Last Change: 2021 Jan 02 " Version: 1.0 " " Credits: @@ -16,4 +16,4 @@ let b:did_ftplugin = 1 setlocal commentstring=#%s let b:undo_ftplugin = "setlocal commentstring<" -" vim: ts=8 ft=vim
\ No newline at end of file +" vim: ts=8 ft=vim diff --git a/runtime/ftplugin/swift.vim b/runtime/ftplugin/swift.vim index 55678f8bfc..a86b782c22 100644 --- a/runtime/ftplugin/swift.vim +++ b/runtime/ftplugin/swift.vim @@ -6,7 +6,16 @@ " See https://swift.org/LICENSE.txt for license information " See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors " -" Vim maintainer: Emir SARI <bitigchi@me.com> +" Vim maintainer: Emir SARI <bitigchi@me.com> +" Last Change: 2021 Jan 08 + +" Only do this when not done yet for this buffer +if exists("b:did_ftplugin") + finish +endif + +let b:did_ftplugin = 1 +let b:undo_ftplugin = "setlocal comments< expandtab< tabstop< shiftwidth< smartindent<" setlocal comments=s1:/*,mb:*,ex:*/,:///,:// setlocal expandtab diff --git a/runtime/ftplugin/vim.vim b/runtime/ftplugin/vim.vim index 4df0d4b59b..6759951daf 100644 --- a/runtime/ftplugin/vim.vim +++ b/runtime/ftplugin/vim.vim @@ -1,7 +1,7 @@ " Vim filetype plugin " Language: Vim " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2020 Aug 14 +" Last Change: 2021 Jan 05 " Only do this when not done yet for this buffer if exists("b:did_ftplugin") @@ -48,18 +48,24 @@ setlocal isk+=# " Use :help to lookup the keyword under the cursor with K. setlocal keywordprg=:help -" Set 'comments' to format dashed lists in comments -" Avoid that #{} starts a comment. -setlocal com=sO:\"\ -,mO:\"\ \ ,sO:#\ -,mO:#\ \ ,eO:##,:\",b:# +" if "\n" .. getline(1, 10)->join("\n") =~# '\n\s*vim9\%[script]\>' +if "\n" .. join(getline(1, 10), "\n") =~# '\n\s*vim9\%[script]\>' + " Set 'comments' to format dashed lists in comments + setlocal com=sO:#\ -,mO:#\ \ ,eO:##,:# + " Comments start with a double quote in a legacy script; + " with # in a Vim9 script + setlocal commentstring=\"%s +else + setlocal com=sO:\"\ -,mO:\"\ \ ,:\" + setlocal commentstring=#%s +endif + " Format comments to be up to 78 characters long if &tw == 0 setlocal tw=78 endif -" Comments start with a double quote; in Vim9 script # would also work -setlocal commentstring=\"%s - " Prefer Vim help instead of manpages. setlocal keywordprg=:help diff --git a/runtime/indent/systemverilog.vim b/runtime/indent/systemverilog.vim index 68487f84ba..590fd4d998 100644 --- a/runtime/indent/systemverilog.vim +++ b/runtime/indent/systemverilog.vim @@ -227,4 +227,4 @@ endfunction let &cpo = s:cpo_save unlet s:cpo_save -" vim:sw=2
\ No newline at end of file +" vim:sw=2 diff --git a/runtime/indent/testdir/vim.in b/runtime/indent/testdir/vim.in index 235f31d061..47e692975f 100644 --- a/runtime/indent/testdir/vim.in +++ b/runtime/indent/testdir/vim.in @@ -22,7 +22,26 @@ let cmd = " END_INDENT " START_INDENT +" INDENT_EXE let g:vim_indent_cont = 5 + +let list = [ +\ 'one', +\ 'two'] + +" END_INDENT + +" START_INDENT " INDENT_EXE unlet g:vim_indent_cont + +let list = [ +'one', +'two', +] +echo + +" END_INDENT + +" START_INDENT " INDENT_AT this-line func Some() let f = x " this-line diff --git a/runtime/indent/testdir/vim.ok b/runtime/indent/testdir/vim.ok index 61369d4b93..3f53c5286c 100644 --- a/runtime/indent/testdir/vim.ok +++ b/runtime/indent/testdir/vim.ok @@ -22,7 +22,26 @@ let cmd = " END_INDENT " START_INDENT +" INDENT_EXE let g:vim_indent_cont = 5 + +let list = [ + \ 'one', + \ 'two'] + +" END_INDENT + +" START_INDENT " INDENT_EXE unlet g:vim_indent_cont + +let list = [ + 'one', + 'two', + ] +echo + +" END_INDENT + +" START_INDENT " INDENT_AT this-line func Some() let f = x " this-line diff --git a/runtime/indent/vim.vim b/runtime/indent/vim.vim index 1303cbab31..21e496802c 100644 --- a/runtime/indent/vim.vim +++ b/runtime/indent/vim.vim @@ -1,7 +1,7 @@ " Vim indent file " Language: Vim script " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2020 Sep 27 +" Last Change: 2021 Jan 06 " Only load this indent file when no other was loaded. if exists("b:did_indent") @@ -52,6 +52,7 @@ function GetVimIndentIntern() return 0 endif let prev_text = getline(lnum) + let found_cont = 0 " Add a 'shiftwidth' after :if, :while, :try, :catch, :finally, :function " and :else. Add it three times for a line that starts with '\' or '"\ ' @@ -83,6 +84,7 @@ function GetVimIndentIntern() endif if cur_text =~ s:lineContPat && v:lnum > 1 && prev_text !~ s:lineContPat + let found_cont = 1 if exists("g:vim_indent_cont") let ind = ind + g:vim_indent_cont else @@ -114,10 +116,50 @@ function GetVimIndentIntern() endif endif + " For a line starting with "}" find the matching "{". If it is at the start + " of the line align with it, probably end of a block. + " Use the mapped "%" from matchit to find the match, otherwise we may match + " a { inside a comment or string. + if cur_text =~ '^\s*}' + if maparg('%') != '' + exe v:lnum + silent! normal % + if line('.') < v:lnum && getline('.') =~ '^\s*{' + let ind = indent('.') + endif + else + " todo: use searchpair() to find a match + endif + endif + + " Below a line starting with "}" find the matching "{". If it is at the + " end of the line we must be below the end of a dictionary. + if prev_text =~ '^\s*}' + if maparg('%') != '' + exe lnum + silent! normal % + if line('.') == lnum || getline('.') !~ '^\s*{' + let ind = ind - shiftwidth() + endif + else + " todo: use searchpair() to find a match + endif + endif + + " Below a line starting with "]" we must be below the end of a list. + if prev_text =~ '^\s*]' + let ind = ind - shiftwidth() + endif + + " A line ending in "{"/"[} is most likely the start of a dict/list literal, + " indent the next line more. Not for a continuation line. + if prev_text =~ '[{[]\s*$' && !found_cont + let ind = ind + shiftwidth() + endif " Subtract a 'shiftwidth' on a :endif, :endwhile, :catch, :finally, :endtry, " :endfun, :else and :augroup END. - if cur_text =~ '^\s*\(ene\@!\|}\|cat\|finall\|el\|aug\%[roup]\s\+[eE][nN][dD]\)' + if cur_text =~ '^\s*\(ene\@!\|cat\|finall\|el\|aug\%[roup]\s\+[eE][nN][dD]\)' let ind = ind - shiftwidth() endif diff --git a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim index 91abe80fb5..a62df1dcec 100644 --- a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim +++ b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim @@ -2,7 +2,7 @@ " " Author: Bram Moolenaar " Copyright: Vim license applies, see ":help license" -" Last Change: 2020 Dec 07 +" Last Change: 2021 Jan 03 " " WORK IN PROGRESS - Only the basics work " Note: On MS-Windows you need a recent version of gdb. The one included with diff --git a/runtime/syntax/abap.vim b/runtime/syntax/abap.vim index 4650109fb1..e48dfc3603 100644 --- a/runtime/syntax/abap.vim +++ b/runtime/syntax/abap.vim @@ -1,7 +1,7 @@ " Vim ABAP syntax file " Language: SAP - ABAP/R4 " Maintainer: Marius Piedallu van Wyk <lailoken@gmail.com> -" Last Change: 2018 Dec 12 +" Last Change: 2021 Jan 02 " Comment: Thanks to EPI-USE Labs for all your assistance. :) " Quit when a syntax file was already loaded @@ -193,4 +193,4 @@ hi def link abapHex Number let b:current_syntax = "abap" -" vim: ts=8 sw=2
\ No newline at end of file +" vim: ts=8 sw=2 diff --git a/runtime/syntax/prolog.vim b/runtime/syntax/prolog.vim index 58b279b029..93aba4dc19 100644 --- a/runtime/syntax/prolog.vim +++ b/runtime/syntax/prolog.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: PROLOG " Maintainer: Anton Kochkov <anton.kochkov@gmail.com> -" Last Change: 2019 Aug 29 +" Last Change: 2021 Jan 05 " There are two sets of highlighting in here: " If the "prolog_highlighting_clean" variable exists, it is rather sparse. @@ -21,16 +21,16 @@ syn case match " Very simple highlighting for comments, clause heads and " character codes. It respects prolog strings and atoms. -syn region prologCComment start=+/\*+ end=+\*/+ -syn match prologComment +%.*+ +syn region prologCComment start=+/\*+ end=+\*/+ contains=@Spell +syn match prologComment +%.*+ contains=@Spell if !exists("prolog_highlighting_no_keyword") syn keyword prologKeyword module meta_predicate multifile dynamic endif syn match prologCharCode +0'\\\=.+ -syn region prologString start=+"+ skip=+\\\\\|\\"+ end=+"+ +syn region prologString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@Spell syn region prologAtom start=+'+ skip=+\\\\\|\\'+ end=+'+ -syn region prologClause matchgroup=prologClauseHead start=+^\s*[a-z]\w*+ matchgroup=Normal end=+\.\s\|\.$+ contains=ALLBUT,prologClause +syn region prologClause matchgroup=prologClauseHead start=+^\s*[a-z]\w*+ matchgroup=Normal end=+\.\s\|\.$+ contains=ALLBUT,prologClause contains=@NoSpell if !exists("prolog_highlighting_clean") |