aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2018-10-30 00:02:55 +0100
committerJustin M. Keyes <justinkz@gmail.com>2018-10-30 00:05:25 +0100
commit18ce6c90636abae594905eecf2e225124ae8ab17 (patch)
treec7def1cc1de8c7c869560eb9770ee6067ae1323d
parent17c26d0dcfcc189cc020464ace67cc0a6f2475bd (diff)
downloadrneovim-18ce6c90636abae594905eecf2e225124ae8ab17.tar.gz
rneovim-18ce6c90636abae594905eecf2e225124ae8ab17.tar.bz2
rneovim-18ce6c90636abae594905eecf2e225124ae8ab17.zip
vim-patch:2c64ca1802b2
Update runtime files https://github.com/vim/vim/commit/2c64ca1802b2c99b16d2fdf581b68b5baffb082a
-rw-r--r--runtime/autoload/phpcomplete.vim90
-rw-r--r--runtime/doc/autocmd.txt1
-rw-r--r--runtime/doc/cmdline.txt42
-rw-r--r--runtime/doc/eval.txt2
-rw-r--r--runtime/doc/help.txt2
-rw-r--r--runtime/doc/indent.txt5
-rw-r--r--runtime/indent/python.vim14
-rw-r--r--runtime/syntax/named.vim2
-rw-r--r--runtime/syntax/nsis.vim6
9 files changed, 133 insertions, 31 deletions
diff --git a/runtime/autoload/phpcomplete.vim b/runtime/autoload/phpcomplete.vim
index 8e38867a77..377baa8432 100644
--- a/runtime/autoload/phpcomplete.vim
+++ b/runtime/autoload/phpcomplete.vim
@@ -3,7 +3,7 @@
" Maintainer: Dávid Szabó ( complex857 AT gmail DOT com )
" Previous Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
" URL: https://github.com/shawncplus/phpcomplete.vim
-" Last Change: 2016 Oct 10
+" Last Change: 2018 Oct 10
"
" OPTIONS:
"
@@ -146,6 +146,8 @@ function! phpcomplete#CompletePHP(findstart, base) " {{{
end
try
+ let eventignore = &eventignore
+ let &eventignore = 'all'
let winheight = winheight(0)
let winnr = winnr()
@@ -216,6 +218,7 @@ function! phpcomplete#CompletePHP(findstart, base) " {{{
endif
finally
silent! exec winnr.'resize '.winheight
+ let &eventignore = eventignore
endtry
endfunction
" }}}
@@ -1393,23 +1396,28 @@ function! phpcomplete#GetCallChainReturnType(classname_candidate, class_candidat
for classstructure in classcontents
let docblock_target_pattern = 'function\s\+&\?'.method.'\>\|\(public\|private\|protected\|var\).\+\$'.method.'\>\|@property.\+\$'.method.'\>'
let doc_str = phpcomplete#GetDocBlock(split(classstructure.content, '\n'), docblock_target_pattern)
- if doc_str != ''
+ let return_type_hint = phpcomplete#GetFunctionReturnTypeHint(split(classstructure.content, '\n'), 'function\s\+&\?'.method.'\>')
+ if doc_str != '' || return_type_hint != ''
break
endif
endfor
- if doc_str != ''
+ if doc_str != '' || return_type_hint != ''
let docblock = phpcomplete#ParseDocBlock(doc_str)
- if has_key(docblock.return, 'type') || has_key(docblock.var, 'type') || len(docblock.properties) > 0
- let type = has_key(docblock.return, 'type') ? docblock.return.type : has_key(docblock.var, 'type') ? docblock.var.type : ''
-
- if type == ''
- for property in docblock.properties
- if property.description =~? method
- let type = property.type
- break
- endif
- endfor
- endif
+ if has_key(docblock.return, 'type') || has_key(docblock.var, 'type') || len(docblock.properties) > 0 || return_type_hint != ''
+ if return_type_hint == ''
+ let type = has_key(docblock.return, 'type') ? docblock.return.type : has_key(docblock.var, 'type') ? docblock.var.type : ''
+
+ if type == ''
+ for property in docblock.properties
+ if property.description =~? method
+ let type = property.type
+ break
+ endif
+ endfor
+ endif
+ else
+ let type = return_type_hint
+ end
" there's a namespace in the type, threat the type as FQCN
if type =~ '\\'
@@ -1483,7 +1491,7 @@ function! phpcomplete#GetMethodStack(line) " {{{
continue
endif
- " if it's looks like a string
+ " if it looks like a string
if current_char == "'" || current_char == '"'
" and it is not escaped
if prev_char != '\' || (prev_char == '\' && prev_prev_char == '\')
@@ -1587,9 +1595,11 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
elseif function_file != '' && filereadable(function_file)
let file_lines = readfile(function_file)
let docblock_str = phpcomplete#GetDocBlock(file_lines, 'function\s*&\?\<'.function_name.'\>')
+ let return_type_hint = phpcomplete#GetFunctionReturnTypeHint(file_lines, 'function\s*&\?'.function_name.'\>')
let docblock = phpcomplete#ParseDocBlock(docblock_str)
- if has_key(docblock.return, 'type')
- let classname_candidate = docblock.return.type
+ let type = has_key(docblock.return, 'type') ? docblock.return.type : return_type_hint
+ if type != ''
+ let classname_candidate = type
let [class_candidate_namespace, function_imports] = phpcomplete#GetCurrentNameSpace(file_lines)
" try to expand the classname of the returned type with the context got from the function's source file
@@ -1821,9 +1831,11 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
elseif function_file != '' && filereadable(function_file)
let file_lines = readfile(function_file)
let docblock_str = phpcomplete#GetDocBlock(file_lines, 'function\s*&\?\<'.function_name.'\>')
+ let return_type_hint = phpcomplete#GetFunctionReturnTypeHint(file_lines, 'function\s*&\?'.function_name.'\>')
let docblock = phpcomplete#ParseDocBlock(docblock_str)
- if has_key(docblock.return, 'type')
- let classname_candidate = docblock.return.type
+ let type = has_key(docblock.return, 'type') ? docblock.return.type : return_type_hint
+ if type != ''
+ let classname_candidate = type
let [class_candidate_namespace, function_imports] = phpcomplete#GetCurrentNameSpace(file_lines)
" try to expand the classname of the returned type with the context got from the function's source file
let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(classname_candidate, class_candidate_namespace, function_imports)
@@ -2413,6 +2425,44 @@ function! phpcomplete#ParseDocBlock(docblock) " {{{
endfunction
" }}}
+function! phpcomplete#GetFunctionReturnTypeHint(sccontent, search)
+ let i = 0
+ let l = 0
+ let function_line_start = -1
+ let function_line_end = -1
+ let sccontent_len = len(a:sccontent)
+ let return_type = ''
+
+ while (i < sccontent_len)
+ let line = a:sccontent[i]
+ " search for a function declaration
+ if line =~? a:search
+ let l = i
+ let function_line_start = i
+ " now search for the first { where the function body starts
+ while l < sccontent_len
+ let line = a:sccontent[l]
+ if line =~? '\V{'
+ let function_line_end = l
+ break
+ endif
+ let l += 1
+ endwhile
+ break
+ endif
+ let i += 1
+ endwhile
+
+ " now grab the lines that holds the function declaration line
+ if function_line_start != -1 && function_line_end != -1
+ let function_line = join(a:sccontent[function_line_start :function_line_end], " ")
+ let class_name_pattern = '[a-zA-Z_\x7f-\xff\\][a-zA-Z_0-9\x7f-\xff\\]*'
+ let return_type = matchstr(function_line, '\c\s*:\s*\zs'.class_name_pattern.'\ze\s*{')
+ endif
+ return return_type
+
+endfunction
+
function! phpcomplete#GetTypeFromDocBlockParam(docblock_type) " {{{
if a:docblock_type !~ '|'
return a:docblock_type
@@ -2572,7 +2622,7 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{
" find kind flags from tags or built in methods for the objects we extracted
" they can be either classes, interfaces or namespaces, no other thing is importable in php
for [key, import] in items(imports)
- " if theres a \ in the name we have it's definetly not a built in thing, look for tags
+ " if theres a \ in the name we have it's definitely not a built in thing, look for tags
if import.name =~ '\\'
let patched_ctags_detected = 0
let [classname, namespace_for_classes] = phpcomplete#ExpandClassName(import.name, '\', {})
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index 9601dfb0f2..75a26bf614 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -287,6 +287,7 @@ Name triggered by ~
|VimSuspend| before Nvim is suspended
Various
+|DiffUpdated| after diffs have been updated
|DirChanged| after the |current-directory| was changed
|FileChangedShell| Vim notices that a file changed since editing started
diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt
index d51940c69e..d4f8d170ef 100644
--- a/runtime/doc/cmdline.txt
+++ b/runtime/doc/cmdline.txt
@@ -495,8 +495,46 @@ after a command causes the rest of the line to be ignored. This can be used
to add comments. Example: >
:set ai "set 'autoindent' option
It is not possible to add a comment to a shell command ":!cmd" or to the
-":map" command and a few others, because they see the '"' as part of their
-argument. This is mentioned where the command is explained.
+":map" command and a few others (mainly commands that expect expressions)
+that see the '"' as part of their argument:
+
+ :argdo
+ :autocmd
+ :bufdo
+ :cexpr (and the like)
+ :call
+ :cdo (and the like)
+ :command
+ :cscope (and the like)
+ :debug
+ :display
+ :echo (and the like)
+ :elseif
+ :execute
+ :folddoopen
+ :folddoclosed
+ :for
+ :grep (and the like)
+ :help (and the like)
+ :if
+ :let
+ :make
+ :map (and the like including :abbrev commands)
+ :menu (and the like)
+ :mkspell
+ :normal
+ :ownsyntax
+ :popup
+ :promptfind (and the like)
+ :registers
+ :return
+ :sort
+ :syntax
+ :tabdo
+ :tearoff
+ :vimgrep (and the like)
+ :while
+ :windo
*:bar* *:\bar*
'|' can be used to separate commands, so you can give multiple commands in one
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 1109225d6a..f03189485c 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -2495,7 +2495,7 @@ assert_exception({error} [, {msg}]) *assert_exception()*
call assert_exception('E492:')
endtry
-assert_fails({cmd} [, {error}]) *assert_fails()*
+assert_fails({cmd} [, {error} [, {msg}]]) *assert_fails()*
Run {cmd} and add an error message to |v:errors| if it does
NOT produce an error.
When {error} is given it must match in |v:errmsg|.
diff --git a/runtime/doc/help.txt b/runtime/doc/help.txt
index 2ae2504b02..976402c915 100644
--- a/runtime/doc/help.txt
+++ b/runtime/doc/help.txt
@@ -182,4 +182,4 @@ will try to find help for it. Especially for options in single quotes, e.g.
'hlsearch'.
------------------------------------------------------------------------------
- vim:tw=78:fo=tcq2:isk=!-~,^*,^\|,^\":ts=8:noet:ft=help:norl:
+ vim:tw=78:isk=!-~,^*,^\|,^\":ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/indent.txt b/runtime/doc/indent.txt
index 1a3456d1a8..aae091aa99 100644
--- a/runtime/doc/indent.txt
+++ b/runtime/doc/indent.txt
@@ -937,6 +937,11 @@ Indent after a nested paren: >
Indent for a continuation line: >
let g:pyindent_continue = '&sw * 2'
+The method uses searchpair() to look back for unclosed parenthesis. This can
+sometimes be slow, thus it timeouts after 150 msec. If you notice the
+indenting isn't correct, you can set a larger timeout in msec: >
+ let g:pyindent_searchpair_timeout = 500
+
R *ft-r-indent*
diff --git a/runtime/indent/python.vim b/runtime/indent/python.vim
index 4ce3c234a5..7ab3cb9f50 100644
--- a/runtime/indent/python.vim
+++ b/runtime/indent/python.vim
@@ -53,6 +53,11 @@ function GetPythonIndent(lnum)
return 0
endif
+ " searchpair() can be slow sometimes, limit the time to 100 msec or what is
+ " put in g:pyindent_searchpair_timeout
+ let searchpair_stopline = 0
+ let searchpair_timeout = get(g:, 'pyindent_searchpair_timeout', 150)
+
" If the previous line is inside parenthesis, use the indent of the starting
" line.
" Trick: use the non-existing "dummy" variable to break out of the loop when
@@ -61,7 +66,8 @@ function GetPythonIndent(lnum)
let parlnum = searchpair('(\|{\|\[', '', ')\|}\|\]', 'nbW',
\ "line('.') < " . (plnum - s:maxoff) . " ? dummy :"
\ . " synIDattr(synID(line('.'), col('.'), 1), 'name')"
- \ . " =~ '\\(Comment\\|Todo\\|String\\)$'")
+ \ . " =~ '\\(Comment\\|Todo\\|String\\)$'",
+ \ searchpair_stopline, searchpair_timeout)
if parlnum > 0
let plindent = indent(parlnum)
let plnumstart = parlnum
@@ -80,14 +86,16 @@ function GetPythonIndent(lnum)
let p = searchpair('(\|{\|\[', '', ')\|}\|\]', 'bW',
\ "line('.') < " . (a:lnum - s:maxoff) . " ? dummy :"
\ . " synIDattr(synID(line('.'), col('.'), 1), 'name')"
- \ . " =~ '\\(Comment\\|Todo\\|String\\)$'")
+ \ . " =~ '\\(Comment\\|Todo\\|String\\)$'",
+ \ searchpair_stopline, searchpair_timeout)
if p > 0
if p == plnum
" When the start is inside parenthesis, only indent one 'shiftwidth'.
let pp = searchpair('(\|{\|\[', '', ')\|}\|\]', 'bW',
\ "line('.') < " . (a:lnum - s:maxoff) . " ? dummy :"
\ . " synIDattr(synID(line('.'), col('.'), 1), 'name')"
- \ . " =~ '\\(Comment\\|Todo\\|String\\)$'")
+ \ . " =~ '\\(Comment\\|Todo\\|String\\)$'",
+ \ searchpair_stopline, searchpair_timeout)
if pp > 0
return indent(plnum) + (exists("g:pyindent_nested_paren") ? eval(g:pyindent_nested_paren) : shiftwidth())
endif
diff --git a/runtime/syntax/named.vim b/runtime/syntax/named.vim
index a5757d5eb9..210d387ece 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 <nick@van-laarhoven.org>
-" Last change: 2007-01-30
+" Last Change: 2007-01-30
" Filenames: named.conf, rndc.conf
" Location: http://www.van-laarhoven.org/vim/syntax/named.vim
"
diff --git a/runtime/syntax/nsis.vim b/runtime/syntax/nsis.vim
index f6d5cab6a8..3389771b78 100644
--- a/runtime/syntax/nsis.vim
+++ b/runtime/syntax/nsis.vim
@@ -3,7 +3,7 @@
" Maintainer: Ken Takata
" URL: https://github.com/k-takata/vim-nsis
" Previous Maintainer: Alex Jakushev <Alex.Jakushev@kemek.lt>
-" Last Change: 2018-02-07
+" Last Change: 2018-10-02
" quit when a syntax file was already loaded
if exists("b:current_syntax")
@@ -104,8 +104,8 @@ syn match nsisSysVar "$\$"
syn match nsisSysVar "$\\["'`]"
"LABELS (4.3)
-syn match nsisLocalLabel contained "[^-+!$0-9;#. \t/*][^ \t:;#]*:\ze\%($\|[ \t;#]\|\/\*\)"
-syn match nsisGlobalLabel contained "\.[^-+!$0-9;# \t/*][^ \t:;#]*:\ze\%($\|[ \t;#]\|\/\*\)"
+syn match nsisLocalLabel contained "[^-+!$0-9;"'#. \t/*][^ \t:;#]*:\ze\%($\|[ \t;#]\|\/\*\)"
+syn match nsisGlobalLabel contained "\.[^-+!$0-9;"'# \t/*][^ \t:;#]*:\ze\%($\|[ \t;#]\|\/\*\)"
"CONSTANTS
syn keyword nsisBoolean contained true false