Skip to content

Commit

Permalink
vim-patch:e0720cbf63eb
Browse files Browse the repository at this point in the history
Update runtime files.

vim/vim@e0720cb
  • Loading branch information
justinmk committed Nov 7, 2017
1 parent 0312fc2 commit 8c6a92c
Show file tree
Hide file tree
Showing 8 changed files with 337 additions and 290 deletions.
4 changes: 2 additions & 2 deletions runtime/doc/filetype.txt
Original file line number Diff line number Diff line change
Expand Up @@ -309,12 +309,12 @@ define yourself. There are a few ways to avoid this:
You need to define your own mapping before the plugin is loaded (before
editing a file of that type). The plugin will then skip installing the
default mapping.

*no_mail_maps*
3. Disable defining mappings for a specific filetype by setting a variable,
which contains the name of the filetype. For the "mail" filetype this
would be: >
:let no_mail_maps = 1
< *no_plugin_maps*
4. Disable defining mappings for all filetypes by setting a variable: >
:let no_plugin_maps = 1
<
Expand Down
2 changes: 1 addition & 1 deletion runtime/doc/ft_rust.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
*ft_rust.txt* Filetype plugin for Rust

==============================================================================
CONTENTS *rust* *ft-rust*
CONTENTS *rust*

1. Introduction |rust-intro|
2. Settings |rust-settings|
Expand Down
7 changes: 7 additions & 0 deletions runtime/doc/message.txt
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,13 @@ a user-defined command.
You tried to set an option after startup that only allows changes during
startup.

*E943* >
Command table needs to be updated, run 'make cmdidxs'
This can only happen when changing the source code, when adding a command in
src/ex_cmds.h. The lookup table then needs to be updated, by running: >
make cmdidxs
==============================================================================
3. Messages *messages*

Expand Down
4 changes: 2 additions & 2 deletions runtime/doc/usr_41.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2227,8 +2227,8 @@ plugin for the mail filetype: >
endif
Two global variables are used:
no_plugin_maps disables mappings for all filetype plugins
no_mail_maps disables mappings for a specific filetype
|no_plugin_maps| disables mappings for all filetype plugins
|no_mail_maps| disables mappings for the "mail" filetype


USER COMMANDS
Expand Down
5 changes: 3 additions & 2 deletions runtime/filetype.vim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
" Vim support file to detect file types
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2017 Mar 13
" Last Change: 2017 Mar 27

" Listen very carefully, I will say this only once
if exists("did_load_filetypes")
Expand Down Expand Up @@ -284,7 +284,8 @@ au BufNewFile,BufRead *.bib setf bib
au BufNewFile,BufRead *.bst setf bst

" BIND configuration
au BufNewFile,BufRead named.conf,rndc.conf setf named
" sudoedit uses namedXXXX.conf
au BufNewFile,BufRead named*.conf,rndc*.conf setf named

" BIND zone
au BufNewFile,BufRead named.root setf bindzone
Expand Down
73 changes: 54 additions & 19 deletions runtime/indent/php.vim
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
" Author: John Wellesz <John.wellesz (AT) teaser (DOT) fr>
" URL: http://www.2072productions.com/vim/indent/php.vim
" Home: https://github.com/2072/PHP-Indenting-for-VIm
" Last Change: 2015 September 8th
" Version: 1.60
" Last Change: 2017 March 12th
" Version: 1.62
"
"
" Type :help php-indent for available options
Expand Down Expand Up @@ -141,11 +141,13 @@ let s:PHP_validVariable = '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*'
let s:notPhpHereDoc = '\%(break\|return\|continue\|exit\|die\|else\)'
let s:blockstart = '\%(\%(\%(}\s*\)\=else\%(\s\+\)\=\)\=if\>\|\%(}\s*\)\?else\>\|do\>\|while\>\|switch\>\|case\>\|default\>\|for\%(each\)\=\>\|declare\>\|class\>\|trait\>\|use\>\|interface\>\|abstract\>\|final\>\|try\>\|\%(}\s*\)\=catch\>\|\%(}\s*\)\=finally\>\)'
let s:functionDecl = '\<function\>\%(\s\+'.s:PHP_validVariable.'\)\=\s*(.*'
let s:endline= '\s*\%(//.*\|#.*\|/\*.*\*/\s*\)\=$'
let s:endline = '\s*\%(//.*\|#.*\|/\*.*\*/\s*\)\=$'
let s:unstated = '\%(^\s*'.s:blockstart.'.*)\|\%(//.*\)\@<!\<e'.'lse\>\)'.s:endline


let s:terminated = '\%(\%(;\%(\s*\%(?>\|}\)\)\=\|<<<\s*[''"]\=\a\w*[''"]\=$\|^\s*}\|^\s*'.s:PHP_validVariable.':\)'.s:endline.'\)\|^[^''"`]*[''"`]$'
let s:terminated = '\%(\%(;\%(\s*\%(?>\|}\)\)\=\|<<<\s*[''"]\=\a\w*[''"]\=$\|^\s*}\|^\s*'.s:PHP_validVariable.':\)'.s:endline.'\)'
let s:PHP_startindenttag = '<?\%(.*?>\)\@!\|<script[^>]*>\%(.*<\/script>\)\@!'
let s:structureHead = '^\s*\%(' . s:blockstart . '\)\|'. s:functionDecl . s:endline . '\|\<new\s\+class\>'



Expand Down Expand Up @@ -214,10 +216,28 @@ function! GetLastRealCodeLNum(startline) " {{{
let lnum = lnum - 1
endwhile
elseif lastline =~ '^[^''"`]*[''"`][;,]'.s:endline
let tofind=substitute( lastline, '^.*\([''"`]\)[;,].*$', '^[^\1]\\+[\1]$', '')
while getline(lnum) !~? tofind && lnum > 1
let lnum = lnum - 1

let tofind=substitute( lastline, '^.*\([''"`]\)[;,].*$', '^[^\1]\\+[\1]$\\|^[^\1]\\+[=([]\\s*[\1]', '')
let trylnum = lnum
while getline(trylnum) !~? tofind && trylnum > 1
let trylnum = trylnum - 1
endwhile

if trylnum == 1
break
else
if lastline =~ ';'.s:endline
while getline(trylnum) !~? s:terminated && getline(trylnum) !~? '{'.s:endline && trylnum > 1
let trylnum = prevnonblank(trylnum - 1)
endwhile


if trylnum == 1
break
end
end
let lnum = trylnum
end
else
break
endif
Expand Down Expand Up @@ -262,7 +282,7 @@ function! FindOpenBracket(lnum, blockStarter) " {{{
while line > 1
let linec = getline(line)

if linec =~ s:terminated || linec =~ '^\s*\%(' . s:blockstart . '\)\|'. s:functionDecl . s:endline
if linec =~ s:terminated || linec =~ s:structureHead
break
endif

Expand All @@ -273,6 +293,20 @@ function! FindOpenBracket(lnum, blockStarter) " {{{
return line
endfun " }}}

let s:blockChars = {'{':1, '[': 1, '(': 1, ')':-1, ']':-1, '}':-1}
function! BalanceDirection (str)

let balance = 0

for c in split(a:str, '\zs')
if has_key(s:blockChars, c)
let balance += s:blockChars[c]
endif
endfor

return balance
endfun

function! FindTheIfOfAnElse (lnum, StopAfterFirstPrevElse) " {{{

if getline(a:lnum) =~# '^\s*}\s*else\%(if\)\=\>'
Expand Down Expand Up @@ -457,7 +491,7 @@ function! GetPhpIndent()

if synname!=""
if synname == "SpecStringEntrails"
let b:InPHPcode = -1
let b:InPHPcode = -1 " thumb down
let b:InPHPcode_tofind = ""
elseif synname != "phpHereDoc" && synname != "phpHereDocDelimiter"
let b:InPHPcode = 1
Expand Down Expand Up @@ -540,7 +574,7 @@ function! GetPhpIndent()
let b:InPHPcode_and_script = 1
endif

elseif last_line =~ '^[^''"`]\+[''"`]$'
elseif last_line =~ '^[^''"`]\+[''"`]$' " a string identifier with nothing after it and no other string identifier before
let b:InPHPcode = -1
let b:InPHPcode_tofind = substitute( last_line, '^.*\([''"`]\).*$', '^[^\1]*\1[;,]$', '')
elseif last_line =~? '<<<\s*[''"]\=\a\w*[''"]\=$'
Expand Down Expand Up @@ -660,7 +694,8 @@ function! GetPhpIndent()

let terminated = s:terminated

let unstated = '\%(^\s*'.s:blockstart.'.*)\|\%(//.*\)\@<!\<e'.'lse\>\)'.endline
let unstated = s:unstated


if ind != b:PHP_default_indenting && cline =~# '^\s*else\%(if\)\=\>'
let b:PHP_CurrentIndentLevel = b:PHP_default_indenting
Expand All @@ -673,7 +708,7 @@ function! GetPhpIndent()

while last_line_num > 1

if previous_line =~ terminated || previous_line =~ '^\s*\%(' . s:blockstart . '\)\|'. s:functionDecl . endline
if previous_line =~ terminated || previous_line =~ s:structureHead

let ind = indent(last_line_num)

Expand All @@ -689,7 +724,7 @@ function! GetPhpIndent()
endwhile

elseif last_line =~# unstated && cline !~ '^\s*);\='.endline
let ind = ind + s:sw()
let ind = ind + s:sw() " we indent one level further when the preceding line is not stated
return ind + addSpecial

elseif (ind != b:PHP_default_indenting || last_line =~ '^[)\]]' ) && last_line =~ terminated
Expand All @@ -699,7 +734,7 @@ function! GetPhpIndent()

let isSingleLineBlock = 0
while 1
if ! isSingleLineBlock && previous_line =~ '^\s*}\|;\s*}'.endline
if ! isSingleLineBlock && previous_line =~ '^\s*}\|;\s*}'.endline " XXX

call cursor(last_line_num, 1)
if previous_line !~ '^}'
Expand Down Expand Up @@ -780,10 +815,10 @@ function! GetPhpIndent()
if !LastLineClosed


if last_line =~# '[{(\[]'.endline || last_line =~? '\h\w*\s*(.*,$' && AntepenultimateLine !~ '[,(\[]'.endline
if last_line =~# '[{(\[]'.endline || last_line =~? '\h\w*\s*(.*,$' && AntepenultimateLine !~ '[,(\[]'.endline && BalanceDirection(last_line) > 0

let dontIndent = 0
if last_line =~ '\S\+\s*{'.endline && last_line !~ '^\s*)\s*{'.endline && last_line !~ '^\s*\%(' . s:blockstart . '\)\|'. s:functionDecl . s:endline
if last_line =~ '\S\+\s*{'.endline && last_line !~ '^\s*[)\]]\+\s*{'.endline && last_line !~ s:structureHead
let dontIndent = 1
endif

Expand All @@ -797,9 +832,9 @@ function! GetPhpIndent()
return ind + addSpecial
endif

elseif last_line =~ '\S\+\s*),'.endline
elseif last_line =~ '\S\+\s*),'.endline && BalanceDirection(last_line) < 0
call cursor(lnum, 1)
call search('),'.endline, 'W')
call search('),'.endline, 'W') " line never begins with ) so no need for 'c' flag
let openedparent = searchpair('(', '', ')', 'bW', 'Skippmatch()')
if openedparent != lnum
let ind = indent(openedparent)
Expand All @@ -809,7 +844,7 @@ function! GetPhpIndent()
let ind = ind + s:sw()


elseif AntepenultimateLine =~ '{'.endline || AntepenultimateLine =~ terminated || AntepenultimateLine =~# s:defaultORcase
elseif AntepenultimateLine =~ '{'.endline && AntepenultimateLine !~? '^\s*use\>' || AntepenultimateLine =~ terminated || AntepenultimateLine =~# s:defaultORcase
let ind = ind + s:sw()
endif

Expand Down
24 changes: 15 additions & 9 deletions runtime/plugin/matchit.vim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
" matchit.vim: (global plugin) Extended "%" matching
" Last Change: 2016 Aug 21
" Last Change: 2017 March 26
" Maintainer: Benji Fisher PhD <benji@member.AMS.org>
" Version: 1.13.2, for Vim 6.3+
" Version: 1.13.3, for Vim 6.3+
" Fix from Tommy Allen included.
" Fix from Fernando Torres included.
" Improvement from Ken Takata included.
Expand Down Expand Up @@ -90,12 +90,15 @@ let s:notslash = '\\\@<!\%(\\\\\)*'

function! s:Match_wrapper(word, forward, mode) range
" In s:CleanUp(), :execute "set" restore_options .
let restore_options = (&ic ? " " : " no") . "ignorecase"
if exists("b:match_ignorecase")
let restore_options = ""
if exists("b:match_ignorecase") && b:match_ignorecase != &ic
let restore_options .= (&ic ? " " : " no") . "ignorecase"
let &ignorecase = b:match_ignorecase
endif
let restore_options = " ve=" . &ve . restore_options
set ve=
if &ve != ''
let restore_options = " ve=" . &ve . restore_options
set ve=
endif
" If this function was called from Visual mode, make sure that the cursor
" is at the correct end of the Visual range:
if a:mode == "v"
Expand Down Expand Up @@ -283,7 +286,9 @@ endfun
" Restore options and do some special handling for Operator-pending mode.
" The optional argument is the tail of the matching group.
fun! s:CleanUp(options, mode, startline, startcol, ...)
execute "set" a:options
if strlen(a:options)
execute "set" a:options
endif
" Open folds, if appropriate.
if a:mode != "o"
if &foldopen =~ "percent"
Expand Down Expand Up @@ -635,8 +640,9 @@ fun! s:MultiMatch(spflag, mode)
if !exists("b:match_words") || b:match_words == ""
return {}
end
let restore_options = (&ic ? "" : "no") . "ignorecase"
if exists("b:match_ignorecase")
let restore_options = ""
if exists("b:match_ignorecase") && b:match_ignorecase != &ic
let restore_options .= (&ic ? " " : " no") . "ignorecase"
let &ignorecase = b:match_ignorecase
endif
let startline = line(".")
Expand Down
Loading

0 comments on commit 8c6a92c

Please sign in to comment.