Skip to content

Commit 7066d50

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents af0da56 + 10ccfb2 commit 7066d50

88 files changed

Lines changed: 1127 additions & 363 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

runtime/autoload/clojurecomplete.vim

Lines changed: 9 additions & 8 deletions
Large diffs are not rendered by default.

runtime/autoload/phpcomplete.vim

Lines changed: 38 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
" Maintainer: Dávid Szabó ( complex857 AT gmail DOT com )
44
" Previous Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
55
" URL: https://github.com/shawncplus/phpcomplete.vim
6-
" Last Change: 2018 Oct 10
6+
" Last Change: 2021 Feb 08
77
"
88
" OPTIONS:
99
"
@@ -122,7 +122,6 @@ function! phpcomplete#CompletePHP(findstart, base) " {{{
122122
endif
123123
endif
124124

125-
126125
" If exists b:php_menu it means completion was already constructed we
127126
" don't need to do anything more
128127
if exists("b:php_menu")
@@ -148,8 +147,6 @@ function! phpcomplete#CompletePHP(findstart, base) " {{{
148147
try
149148
let eventignore = &eventignore
150149
let &eventignore = 'all'
151-
let winheight = winheight(0)
152-
let winnr = winnr()
153150

154151
let [current_namespace, imports] = phpcomplete#GetCurrentNameSpace(getline(0, line('.')))
155152

@@ -183,7 +180,6 @@ function! phpcomplete#CompletePHP(findstart, base) " {{{
183180
endif
184181

185182
if filereadable(classlocation)
186-
let classfile = readfile(classlocation)
187183
let classcontent = ''
188184
let classcontent .= "\n".phpcomplete#GetClassContents(classlocation, classname)
189185
let sccontent = split(classcontent, "\n")
@@ -217,7 +213,6 @@ function! phpcomplete#CompletePHP(findstart, base) " {{{
217213
return phpcomplete#CompleteGeneral(a:base, current_namespace, imports)
218214
endif
219215
finally
220-
silent! exec winnr.'resize '.winheight
221216
let &eventignore = eventignore
222217
endtry
223218
endfunction
@@ -1025,7 +1020,7 @@ function! phpcomplete#CompleteUserClass(context, base, sccontent, visibility) "
10251020
let c_var = '$'.c_var
10261021
endif
10271022
let c_variables[c_var] = ''
1028-
if g:phpcomplete_parse_docblock_comments && len(get(variables, var_index)) > 0
1023+
if g:phpcomplete_parse_docblock_comments && len(get(variables, var_index, '')) > 0
10291024
let c_doc[c_var] = phpcomplete#GetDocBlock(a:sccontent, variables[var_index])
10301025
endif
10311026
let var_index += 1
@@ -2082,26 +2077,17 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam
20822077
" ...
20832078
" ]
20842079
"
2085-
let full_file_path = fnamemodify(a:file_path, ':p')
20862080
let class_name_pattern = '[a-zA-Z_\x7f-\xff\\][a-zA-Z_0-9\x7f-\xff\\]*'
2087-
let cfile = join(a:file_lines, "\n")
2081+
let full_file_path = fnamemodify(a:file_path, ':p')
20882082
let result = []
2089-
" We use new buffer and (later) normal! because
2090-
" this is the most efficient way. The other way
2091-
" is to go through the looong string looking for
2092-
" matching {}
2093-
2094-
" remember the window we started at
2095-
let phpcomplete_original_window = winnr()
2096-
2097-
silent! below 1new
2098-
silent! 0put =cfile
2099-
call search('\c\(class\|interface\|trait\)\_s\+'.a:class_name.'\(\>\|$\)')
2100-
let cfline = line('.')
2101-
call search('{')
2102-
let endline = line('.')
2103-
2104-
let content = join(getline(cfline, endline), "\n")
2083+
let popup_id = popup_create(a:file_lines, {'hidden': v:true})
2084+
2085+
call win_execute(popup_id, 'call search(''\c\(class\|interface\|trait\)\_s\+'.a:class_name.'\(\>\|$\)'')')
2086+
call win_execute(popup_id, "let cfline = line('.')")
2087+
call win_execute(popup_id, "call search('{')")
2088+
call win_execute(popup_id, "let endline = line('.')")
2089+
2090+
call win_execute(popup_id, 'let content = join(getline('.cfline.', '.endline.'), "\n")')
21052091
" Catch extends
21062092
if content =~? 'extends'
21072093
let extends_string = matchstr(content, '\(class\|interface\)\_s\+'.a:class_name.'\_.\+extends\_s\+\zs\('.class_name_pattern.'\(,\|\_s\)*\)\+\ze\(extends\|{\)')
@@ -2117,37 +2103,39 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam
21172103
else
21182104
let implemented_interfaces = []
21192105
endif
2120-
call searchpair('{', '', '}', 'W')
2121-
let class_closing_bracket_line = line('.')
2106+
2107+
call win_execute(popup_id, 'let [class_closing_bracket_line, class_closing_bracket_col] = searchpairpos("{", "", "}", "W")')
21222108

21232109
" Include class docblock
21242110
let doc_line = cfline - 1
2125-
if getline(doc_line) =~? '^\s*\*/'
2111+
call win_execute(popup_id, 'let l = getline('.doc_line.')')
2112+
if l =~? '^\s*\*/'
21262113
while doc_line != 0
2127-
if getline(doc_line) =~? '^\s*/\*\*'
2114+
call win_execute(popup_id, 'let l = getline('.doc_line.')')
2115+
if l =~? '^\s*/\*\*'
21282116
let cfline = doc_line
21292117
break
21302118
endif
21312119
let doc_line -= 1
21322120
endwhile
21332121
endif
21342122

2135-
let classcontent = join(getline(cfline, class_closing_bracket_line), "\n")
2123+
call win_execute(popup_id, 'let classcontent = join(getline('.cfline.', '.class_closing_bracket_line.'), "\n")')
21362124

21372125
let used_traits = []
21382126
" move back to the line next to the class's definition
2139-
call cursor(endline + 1, 1)
2127+
call win_execute(popup_id, 'call cursor('.(endline + 1).', 1)')
21402128
let keep_searching = 1
21412129
while keep_searching != 0
21422130
" try to grab "use..." keywords
2143-
let [lnum, col] = searchpos('\c^\s\+use\s\+'.class_name_pattern, 'cW', class_closing_bracket_line)
2144-
let syn_name = synIDattr(synID(lnum, col, 0), "name")
2131+
call win_execute(popup_id, 'let [lnum, col] = searchpos(''\c^\s\+use\s\+'.class_name_pattern.''', "cW", '.class_closing_bracket_line.')')
2132+
call win_execute(popup_id, 'let syn_name = synIDattr(synID('.lnum.', '.col.', 0), "name")')
21452133
if syn_name =~? 'string\|comment'
2146-
call cursor(lnum + 1, 1)
2134+
call win_execute(popup_id, 'call cursor('.(lnum + 1).', 1)')
21472135
continue
21482136
endif
21492137

2150-
let trait_line = getline(lnum)
2138+
call win_execute(popup_id, 'let trait_line = getline('.lnum.')')
21512139
if trait_line !~? ';'
21522140
" try to find the next line containing ';'
21532141
let l = lnum
@@ -2157,25 +2145,23 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam
21572145
while search_line !~? ';' && l > 0
21582146
" file lines are reversed so we need to go backwards
21592147
let l += 1
2160-
let search_line = getline(l)
2148+
call win_execute(popup_id, 'let search_line = getline('.l.')')
21612149
let trait_line .= ' '.substitute(search_line, '\(^\s\+\|\s\+$\)', '', 'g')
21622150
endwhile
21632151
endif
21642152
let use_expression = matchstr(trait_line, '^\s*use\s\+\zs.\{-}\ze;')
21652153
let use_parts = map(split(use_expression, '\s*,\s*'), 'substitute(v:val, "\\s+", " ", "g")')
21662154
let used_traits += map(use_parts, 'substitute(v:val, "\\s", "", "g")')
2167-
call cursor(lnum + 1, 1)
2155+
call win_execute(popup_id, 'call cursor('.(lnum + 1).', 1)')
21682156

21692157
if [lnum, col] == [0, 0]
21702158
let keep_searching = 0
21712159
endif
21722160
endwhile
21732161

2174-
silent! bw! %
2162+
call popup_close(popup_id)
21752163

21762164
let [current_namespace, imports] = phpcomplete#GetCurrentNameSpace(a:file_lines[0:cfline])
2177-
" go back to original window
2178-
exe phpcomplete_original_window.'wincmd w'
21792165
call add(result, {
21802166
\ 'class': a:class_name,
21812167
\ 'content': classcontent,
@@ -2532,40 +2518,37 @@ function! phpcomplete#FormatDocBlock(info) " {{{
25322518
endif
25332519

25342520
return res
2535-
endfunction!
2521+
endfunction
25362522
" }}}
25372523

25382524
function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{
2539-
let original_window = winnr()
2540-
2541-
silent! below 1new
2542-
silent! 0put =a:file_lines
2543-
normal! G
2525+
let popup_id = popup_create(a:file_lines, {'hidden': v:true})
2526+
call win_execute(popup_id, 'normal! G')
25442527

25452528
" clear out classes, functions and other blocks
25462529
while 1
2547-
let block_start_pos = searchpos('\c\(class\|trait\|function\|interface\)\s\+\_.\{-}\zs{', 'Web')
2530+
call win_execute(popup_id, 'let block_start_pos = searchpos(''\c\(class\|trait\|function\|interface\)\s\+\_.\{-}\zs{'', "Web")')
25482531
if block_start_pos == [0, 0]
25492532
break
25502533
endif
2551-
let block_end_pos = searchpairpos('{', '', '}\|\%$', 'W', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment"')
2534+
call win_execute(popup_id, 'let block_end_pos = searchpairpos("{", "", ''}\|\%$'', "W", ''synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment"'')')
25522535

2536+
let popup_lines = winbufnr(popup_id)->getbufline(1, '$')
25532537
if block_end_pos != [0, 0]
25542538
" end of the block found, just delete it
2555-
silent! exec block_start_pos[0].','.block_end_pos[0].'d _'
2539+
call remove(popup_lines, block_start_pos[0] - 1, block_end_pos[0] - 1)
25562540
else
25572541
" block pair not found, use block start as beginning and the end
25582542
" of the buffer instead
2559-
silent! exec block_start_pos[0].',$d _'
2543+
call remove(popup_lines, block_start_pos[0] - 1, -1)
25602544
endif
2545+
call popup_settext(popup_id, popup_lines)
25612546
endwhile
2562-
normal! G
2547+
call win_execute(popup_id, 'normal! G', 'silent!')
25632548

25642549
" grab the remains
2565-
let file_lines = reverse(getline(1, line('.') - 1))
2566-
2567-
silent! bw! %
2568-
exe original_window.'wincmd w'
2550+
call win_execute(popup_id, "let file_lines = reverse(getline(1, line('.')-1))")
2551+
call popup_close(popup_id)
25692552

25702553
let namespace_name_pattern = '[a-zA-Z_\x7f-\xff\\][a-zA-Z_0-9\x7f-\xff\\]*'
25712554
let i = 0

runtime/doc/diff.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*diff.txt* For Vim version 8.2. Last change: 2019 Nov 10
1+
*diff.txt* For Vim version 8.2. Last change: 2021 Feb 10
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -59,7 +59,7 @@ In each of the edited files these options are set:
5959
'scrollbind' on
6060
'cursorbind' on
6161
'scrollopt' includes "hor"
62-
'wrap' off
62+
'wrap' off, or leave as-is if 'diffopt' includes "followwrap"
6363
'foldmethod' "diff"
6464
'foldcolumn' value from 'diffopt', default is 2
6565

@@ -144,7 +144,7 @@ Otherwise they are set to their default value:
144144
'scrollbind' off
145145
'cursorbind' off
146146
'scrollopt' without "hor"
147-
'wrap' on
147+
'wrap' on, or leave as-is if 'diffopt' includes "followwrap"
148148
'foldmethod' "manual"
149149
'foldcolumn' 0
150150

runtime/doc/eval.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*eval.txt* For Vim version 8.2. Last change: 2021 Jan 31
1+
*eval.txt* For Vim version 8.2. Last change: 2021 Feb 10
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -5915,6 +5915,7 @@ getreg([{regname} [, 1 [, {list}]]]) *getreg()*
59155915
When the register was not set an empty list is returned.
59165916

59175917
If {regname} is not specified, |v:register| is used.
5918+
In |Vim9-script| {regname} must be one character.
59185919

59195920
Can also be used as a |method|: >
59205921
GetRegname()->getreg()
@@ -5942,6 +5943,7 @@ getreginfo([{regname}]) *getreginfo()*
59425943
will be returned.
59435944
If {regname} is not specified, |v:register| is used.
59445945
The returned Dictionary can be passed to |setreg()|.
5946+
In |Vim9-script| {regname} must be one character.
59455947

59465948
Can also be used as a |method|: >
59475949
GetRegname()->getreginfo()
@@ -5955,6 +5957,7 @@ getregtype([{regname}]) *getregtype()*
59555957
"" for an empty or unknown register
59565958
<CTRL-V> is one character with value 0x16.
59575959
If {regname} is not specified, |v:register| is used.
5960+
In |Vim9-script| {regname} must be one character.
59585961

59595962
Can also be used as a |method|: >
59605963
GetRegname()->getregtype()
@@ -9670,6 +9673,7 @@ setqflist({list} [, {action} [, {what}]]) *setqflist()*
96709673
setreg({regname}, {value} [, {options}])
96719674
Set the register {regname} to {value}.
96729675
If {regname} is "" or "@", the unnamed register '"' is used.
9676+
In |Vim9-script| {regname} must be one character.
96739677

96749678
{value} may be any value returned by |getreg()| or
96759679
|getreginfo()|, including a |List| or |Dict|.

runtime/doc/indent.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -610,14 +610,14 @@ the use of square and curly brackets, and otherwise by community convention.
610610
These conventions are not universally followed, so the Clojure indent script
611611
offers a few configurable options, listed below.
612612

613-
If the current vim does not include |searchpairpos()|, the indent script falls
613+
If the current vim does not include searchpairpos(), the indent script falls
614614
back to normal 'lisp' indenting, and the following options are ignored.
615615

616616
*g:clojure_maxlines*
617617

618-
Set maximum scan distance of |searchpairpos()|. Larger values trade
619-
performance for correctness when dealing with very long forms. A value of 0
620-
will scan without limits.
618+
Set maximum scan distance of searchpairpos(). Larger values trade performance
619+
for correctness when dealing with very long forms. A value of 0 will scan
620+
without limits.
621621
>
622622
" Default
623623
let g:clojure_maxlines = 100

runtime/doc/index.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*index.txt* For Vim version 8.2. Last change: 2021 Jan 15
1+
*index.txt* For Vim version 8.2. Last change: 2021 Feb 11
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1176,6 +1176,7 @@ tag command action ~
11761176
|:bNext| :bN[ext] go to previous buffer in the buffer list
11771177
|:ball| :ba[ll] open a window for each buffer in the buffer list
11781178
|:badd| :bad[d] add buffer to the buffer list
1179+
|:balt| :balt like ":badd" but also set the alternate file
11791180
|:bdelete| :bd[elete] remove a buffer from the buffer list
11801181
|:behave| :be[have] set mouse and selection behavior
11811182
|:belowright| :bel[owright] make split window appear right or below

runtime/doc/options.txt

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*options.txt* For Vim version 8.2. Last change: 2021 Jan 08
1+
*options.txt* For Vim version 8.2. Last change: 2021 Feb 13
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1573,7 +1573,11 @@ A jump table for the options with a short description can be found at |Q_op|.
15731573
{only in GUI versions or when the |+xterm_clipboard|
15741574
feature is included}
15751575
This option is a list of comma separated names.
1576-
These names are recognized:
1576+
Note: if one of the items is "exclude:", then you can't add an item
1577+
after that. Therefore do append an item with += but use ^= to
1578+
prepend, e.g.: >
1579+
set clipboard^=unnamed
1580+
< These names are recognized:
15771581

15781582
*clipboard-unnamed*
15791583
unnamed When included, Vim will use the clipboard register '*'
@@ -2692,6 +2696,8 @@ A jump table for the options with a short description can be found at |Q_op|.
26922696
foldcolumn:{n} Set the 'foldcolumn' option to {n} when
26932697
starting diff mode. Without this 2 is used.
26942698

2699+
followwrap Follow the 'wrap' option and leave as it is.
2700+
26952701
internal Use the internal diff library. This is
26962702
ignored when 'diffexpr' is set. *E960*
26972703
When running out of memory when writing a
@@ -3244,7 +3250,7 @@ A jump table for the options with a short description can be found at |Q_op|.
32443250
Only normal file name characters can be used, "/\*?[|<>" are illegal.
32453251

32463252
*'fillchars'* *'fcs'*
3247-
'fillchars' 'fcs' string (default "vert:|,fold:-")
3253+
'fillchars' 'fcs' string (default "vert:|,fold:-,eob:~")
32483254
global
32493255
{not available when compiled without the |+folding|
32503256
feature}
@@ -3257,6 +3263,7 @@ A jump table for the options with a short description can be found at |Q_op|.
32573263
vert:c '|' vertical separators |:vsplit|
32583264
fold:c '-' filling 'foldtext'
32593265
diff:c '-' deleted lines of the 'diff' option
3266+
eob:c '~' empty lines below the end of a buffer
32603267

32613268
Any one that is omitted will fall back to the default. For "stl" and
32623269
"stlnc" the space will be used when there is highlighting, '^' or '='
@@ -3276,6 +3283,7 @@ A jump table for the options with a short description can be found at |Q_op|.
32763283
vert:c VertSplit |hl-VertSplit|
32773284
fold:c Folded |hl-Folded|
32783285
diff:c DiffDelete |hl-DiffDelete|
3286+
eob:c EndOfBuffer |hl-EndOfBuffer|
32793287

32803288
*'fixendofline'* *'fixeol'* *'nofixendofline'* *'nofixeol'*
32813289
'fixendofline' 'fixeol' boolean (default on)
@@ -4975,8 +4983,10 @@ A jump table for the options with a short description can be found at |Q_op|.
49754983
*lcs-lead*
49764984
lead:c Character to show for leading spaces. When omitted,
49774985
leading spaces are blank. Overrides the "space"
4978-
setting for leading spaces.
4979-
*lcs-trail*
4986+
setting for leading spaces. You can combine it with
4987+
"tab:", for example: >
4988+
:set listchars+=tab:>-,lead:.
4989+
< *lcs-trail*
49804990
trail:c Character to show for trailing spaces. When omitted,
49814991
trailing spaces are blank. Overrides the "space"
49824992
setting for trailing spaces.
@@ -6372,7 +6382,7 @@ A jump table for the options with a short description can be found at |Q_op|.
63726382
$VIMRUNTIME,
63736383
$VIM/vimfiles/after,
63746384
home:vimfiles/after"
6375-
PC: "$HOME/vimfiles,
6385+
MS-Windows: "$HOME/vimfiles,
63766386
$VIM/vimfiles,
63776387
$VIMRUNTIME,
63786388
$VIM/vimfiles/after,
@@ -6384,8 +6394,8 @@ A jump table for the options with a short description can be found at |Q_op|.
63846394
$VIM/vimfiles,
63856395
$VIMRUNTIME,
63866396
$VIM/vimfiles/after,
6387-
$BE_USER_SETTINGS/vim/after")
6388-
VMS: "sys$login:vimfiles,
6397+
$BE_USER_SETTINGS/vim/after"
6398+
VMS: "sys$login:vimfiles,
63896399
$VIM/vimfiles,
63906400
$VIMRUNTIME,
63916401
$VIM/vimfiles/after,

0 commit comments

Comments
 (0)