Skip to content

Commit 5393ecb

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents 1204c03 + 63dbfd3 commit 5393ecb

93 files changed

Lines changed: 3430 additions & 2658 deletions

Some content is hidden

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

Filelist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ SRC_ALL = \
1212
src/README.txt \
1313
src/alloc.h \
1414
src/arabic.c \
15-
src/arabic.h \
1615
src/ascii.h \
1716
src/autocmd.c \
1817
src/beval.c \

runtime/autoload/dist/ft.vim

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ func dist#ft#FTe()
197197
exe 'setf ' . g:filetype_euphoria
198198
else
199199
let n = 1
200-
while n < 100 && n < line("$")
200+
while n < 100 && n <= line("$")
201201
if getline(n) =~ "^\\s*\\(<'\\|'>\\)\\s*$"
202202
setf specman
203203
return
@@ -211,7 +211,7 @@ endfunc
211211
" Distinguish between HTML, XHTML and Django
212212
func dist#ft#FThtml()
213213
let n = 1
214-
while n < 10 && n < line("$")
214+
while n < 10 && n <= line("$")
215215
if getline(n) =~ '\<DTD\s\+XHTML\s'
216216
setf xhtml
217217
return
@@ -222,13 +222,13 @@ func dist#ft#FThtml()
222222
endif
223223
let n = n + 1
224224
endwhile
225-
setf html
225+
setf FALLBACK html
226226
endfunc
227227

228228
" Distinguish between standard IDL and MS-IDL
229229
func dist#ft#FTidl()
230230
let n = 1
231-
while n < 50 && n < line("$")
231+
while n < 50 && n <= line("$")
232232
if getline(n) =~ '^\s*import\s\+"\(unknwn\|objidl\)\.idl"'
233233
setf msidl
234234
return
@@ -699,7 +699,7 @@ endfunc
699699

700700
func dist#ft#FTxml()
701701
let n = 1
702-
while n < 100 && n < line("$")
702+
while n < 100 && n <= line("$")
703703
let line = getline(n)
704704
" DocBook 4 or DocBook 5.
705705
let is_docbook4 = line =~ '<!DOCTYPE.*DocBook'
@@ -725,7 +725,7 @@ endfunc
725725

726726
func dist#ft#FTy()
727727
let n = 1
728-
while n < 100 && n < line("$")
728+
while n < 100 && n <= line("$")
729729
let line = getline(n)
730730
if line =~ '^\s*%'
731731
setf yacc

runtime/doc/autocmd.txt

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*autocmd.txt* For Vim version 8.1. Last change: 2019 Jan 19
1+
*autocmd.txt* For Vim version 8.1. Last change: 2019 Mar 13
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -621,6 +621,8 @@ CursorMoved After the cursor was moved in Normal or Visual
621621
Not triggered when there is typeahead or when
622622
an operator is pending.
623623
For an example see |match-parens|.
624+
Note: This can not be skipped with
625+
`:noautocmd`.
624626
Careful: This is triggered very often, don't
625627
do anything that the user does not expect or
626628
that is slow.
@@ -1024,6 +1026,8 @@ TextChanged After a change was made to the text in the
10241026
was defined).
10251027
Not triggered when there is typeahead or when
10261028
an operator is pending.
1029+
Note: This can not be skipped with
1030+
`:noautocmd`.
10271031
Careful: This is triggered very often, don't
10281032
do anything that the user does not expect or
10291033
that is slow.
@@ -1465,8 +1469,8 @@ If you want the buffer to be unmodified after changing it, reset the
14651469
instead of ":q!".
14661470

14671471
*autocmd-nested* *E218*
1468-
By default, autocommands do not nest. If you use ":e" or ":w" in an
1469-
autocommand, Vim does not execute the BufRead and BufWrite autocommands for
1472+
By default, autocommands do not nest. For example, if you use ":e" or ":w" in
1473+
an autocommand, Vim does not execute the BufRead and BufWrite autocommands for
14701474
those commands. If you do want this, use the "nested" flag for those commands
14711475
in which you want nesting. For example: >
14721476
:autocmd FileChangedShell *.c nested e!
@@ -1612,5 +1616,8 @@ following command. Example: >
16121616
This will write the file without triggering the autocommands defined by the
16131617
gzip plugin.
16141618

1619+
Note that some autocommands are not triggered right away, but only later.
1620+
This specifically applies to |CursorMoved| and |TextChanged|.
1621+
16151622

16161623
vim:tw=78:ts=8:noet:ft=help:norl:

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.1. Last change: 2017 Oct 03
1+
*diff.txt* For Vim version 8.1. Last change: 2019 Feb 27
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -179,8 +179,8 @@ loaded. Since Vim doesn't allow having two buffers for the same file, you
179179
need another buffer. This command is useful: >
180180
command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_
181181
\ | diffthis | wincmd p | diffthis
182-
(this is in |vimrc_example.vim|). Use ":DiffOrig" to see the differences
183-
between the current buffer and the file it was loaded from.
182+
(this is in |defaults.vim|). Use ":DiffOrig" to see the differences between
183+
the current buffer and the file it was loaded from.
184184

185185
A buffer that is unloaded cannot be used for the diff. But it does work for
186186
hidden buffers. You can use ":hide" to close a window without unloading the

runtime/doc/eval.txt

Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*eval.txt* For Vim version 8.1. Last change: 2019 Feb 22
1+
*eval.txt* For Vim version 8.1. Last change: 2019 Mar 02
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -2672,6 +2672,7 @@ test_null_partial() Funcref null value for testing
26722672
test_null_string() String null value for testing
26732673
test_option_not_set({name}) none reset flag indicating option was set
26742674
test_override({expr}, {val}) none test with Vim internal overrides
2675+
test_refcount({expr}) Number get the reference count of {expr}
26752676
test_scrollbar({which}, {value}, {dragging})
26762677
none scroll in the GUI for testing
26772678
test_settime({expr}) none set current time for testing
@@ -3538,7 +3539,7 @@ complete_check() *complete_check()*
35383539

35393540
*confirm()*
35403541
confirm({msg} [, {choices} [, {default} [, {type}]]])
3541-
Confirm() offers the user a dialog, from which a choice can be
3542+
confirm() offers the user a dialog, from which a choice can be
35423543
made. It returns the number of the choice. For the first
35433544
choice this is 1.
35443545
Note: confirm() is only supported when compiled with dialog
@@ -4061,7 +4062,7 @@ expand({expr} [, {nosuf} [, {list}]]) *expand()*
40614062
all "README" files in the current directory and below: >
40624063
:echo expand("**/README")
40634064
<
4064-
Expand() can also be used to expand variables and environment
4065+
expand() can also be used to expand variables and environment
40654066
variables that are only known in a shell. But this can be
40664067
slow, because a shell may be used to do the expansion. See
40674068
|expr-env-expand|.
@@ -4964,10 +4965,16 @@ getloclist({nr} [, {what}]) *getloclist()*
49644965
If the optional {what} dictionary argument is supplied, then
49654966
returns the items listed in {what} as a dictionary. Refer to
49664967
|getqflist()| for the supported items in {what}.
4967-
If {what} contains 'filewinid', then returns the id of the
4968-
window used to display files from the location list. This
4969-
field is applicable only when called from a location list
4970-
window. See |location-list-file-window| for more details.
4968+
4969+
In addition to the items supported by |getqflist()| in {what},
4970+
the following item is supported by |getloclist()|:
4971+
4972+
filewinid id of the window used to display files
4973+
from the location list. This field is
4974+
applicable only when called from a
4975+
location list window. See
4976+
|location-list-file-window| for more
4977+
details.
49714978

49724979
getmatches() *getmatches()*
49734980
Returns a |List| with all matches previously defined by
@@ -5069,6 +5076,9 @@ getqflist([{what}]) *getqflist()*
50695076
nr get information for this quickfix list; zero
50705077
means the current quickfix list and "$" means
50715078
the last quickfix list
5079+
qfbufnr number of the buffer displayed in the quickfix
5080+
window. Returns 0 if the quickfix buffer is
5081+
not present. See |quickfix-buffer|.
50725082
size number of entries in the quickfix list
50735083
title get the list title |quickfix-title|
50745084
winid get the quickfix |window-ID|
@@ -5097,6 +5107,8 @@ getqflist([{what}]) *getqflist()*
50975107
items quickfix list entries. If not present, set to
50985108
an empty list.
50995109
nr quickfix list number. If not present, set to 0
5110+
qfbufnr number of the buffer displayed in the quickfix
5111+
window. If not present, set to 0.
51005112
size number of entries in the quickfix list. If not
51015113
present, set to 0.
51025114
title quickfix list title text. If not present, set
@@ -9578,6 +9590,11 @@ test_override({name}, {val}) *test_override()*
95789590
< The value of "starting" is saved. It is restored by: >
95799591
call test_override('starting', 0)
95809592
9593+
test_refcount({expr}) *test_refcount()*
9594+
Return the reference count of {expr}. When {expr} is of a
9595+
type that does not have a reference count, returns -1. Only
9596+
to be used for testing.
9597+
95819598
test_scrollbar({which}, {value}, {dragging}) *test_scrollbar()*
95829599
Pretend using scrollbar {which} to move it to position
95839600
{value}. {which} can be:
@@ -11208,14 +11225,14 @@ This does NOT work: >
1120811225
commands are skipped.
1120911226
When {pattern} is omitted all errors are caught.
1121011227
Examples: >
11211-
:catch /^Vim:Interrupt$/ " catch interrupts (CTRL-C)
11212-
:catch /^Vim\%((\a\+)\)\=:E/ " catch all Vim errors
11213-
:catch /^Vim\%((\a\+)\)\=:/ " catch errors and interrupts
11214-
:catch /^Vim(write):/ " catch all errors in :write
11215-
:catch /^Vim\%((\a\+)\)\=:E123/ " catch error E123
11216-
:catch /my-exception/ " catch user exception
11217-
:catch /.*/ " catch everything
11218-
:catch " same as /.*/
11228+
:catch /^Vim:Interrupt$/ " catch interrupts (CTRL-C)
11229+
:catch /^Vim\%((\a\+)\)\=:E/ " catch all Vim errors
11230+
:catch /^Vim\%((\a\+)\)\=:/ " catch errors and interrupts
11231+
:catch /^Vim(write):/ " catch all errors in :write
11232+
:catch /^Vim\%((\a\+)\)\=:E123:/ " catch error E123
11233+
:catch /my-exception/ " catch user exception
11234+
:catch /.*/ " catch everything
11235+
:catch " same as /.*/
1121911236
<
1122011237
Another character can be used instead of / around the
1122111238
{pattern}, so long as it does not have a special

runtime/doc/if_lua.txt

Lines changed: 50 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ The Lua Interface to Vim *lua* *Lua*
1010
2. The vim module |lua-vim|
1111
3. List userdata |lua-list|
1212
4. Dict userdata |lua-dict|
13-
5. Funcref userdata |lua-funcref|
14-
6. Buffer userdata |lua-buffer|
15-
7. Window userdata |lua-window|
16-
8. The luaeval function |lua-luaeval|
17-
9. Dynamic loading |lua-dynamic|
13+
5. Blob userdata |lua-blob|
14+
6. Funcref userdata |lua-funcref|
15+
7. Buffer userdata |lua-buffer|
16+
8. Window userdata |lua-window|
17+
9. luaeval() Vim function |lua-luaeval|
18+
10. Dynamic loading |lua-dynamic|
1819

1920
{Vi does not have any of these commands}
2021

@@ -140,6 +141,14 @@ Vim evaluation and command execution, and others.
140141
:echo luaeval('vim.dict(t)')
141142
:" {'1': 3.141593, '2': v:false,
142143
:" 'say': 'hi'}
144+
<
145+
vim.blob([arg]) Returns an empty blob or, if "arg" is a Lua
146+
string, returns a blob b such that b is
147+
equivalent to "arg" as a byte string.
148+
Examples: >
149+
:lua s = "12ab\x00\x80\xfe\xff"
150+
:echo luaeval('vim.blob(s)')
151+
:" 0z31326162.0080FEFF
143152
<
144153
vim.funcref({name}) Returns a Funcref to function {name} (see
145154
|Funcref|). It is equivalent to Vim's
@@ -260,7 +269,34 @@ Examples:
260269
<
261270

262271
==============================================================================
263-
5. Funcref userdata *lua-funcref*
272+
5. Blob userdata *lua-blob*
273+
274+
Blob userdata represent vim blobs. A blob "b" has the following properties:
275+
276+
Properties
277+
----------
278+
o "#b" is the length of blob "b", equivalent to "len(b)" in Vim.
279+
o "b[k]" returns the k-th item in "b"; "b" is zero-indexed, as in Vim.
280+
To modify the k-th item, simply do "b[k] = number"; in particular,
281+
"b[#b] = number" can append a byte to tail.
282+
283+
Methods
284+
-------
285+
o "b:add(bytes)" appends "bytes" to the end of "b".
286+
287+
Examples:
288+
>
289+
:let b = 0z001122
290+
:lua b = vim.eval('b') -- same 'b'
291+
:lua print(b, b[0], #b)
292+
:lua b[1] = 32
293+
:lua b[#b] = 0x33 -- append a byte to tail
294+
:lua b:add("\x80\x81\xfe\xff")
295+
:echo b
296+
<
297+
298+
==============================================================================
299+
6. Funcref userdata *lua-funcref*
264300

265301
Funcref userdata represent funcref variables in Vim. Funcrefs that were
266302
defined with a "dict" attribute need to be obtained as a dictionary key
@@ -293,7 +329,7 @@ Examples:
293329
<
294330

295331
==============================================================================
296-
6. Buffer userdata *lua-buffer*
332+
7. Buffer userdata *lua-buffer*
297333

298334
Buffer userdata represent vim buffers. A buffer userdata "b" has the following
299335
properties and methods:
@@ -345,7 +381,7 @@ Examples:
345381
<
346382

347383
==============================================================================
348-
7. Window userdata *lua-window*
384+
8. Window userdata *lua-window*
349385

350386
Window objects represent vim windows. A window userdata "w" has the following
351387
properties and methods:
@@ -377,7 +413,7 @@ Examples:
377413
<
378414

379415
==============================================================================
380-
8. The luaeval function *lua-luaeval* *lua-eval*
416+
9. luaeval() Vim function *lua-luaeval* *lua-eval*
381417

382418
The (dual) equivalent of "vim.eval" for passing Lua values to Vim is
383419
"luaeval". "luaeval" takes an expression string and an optional argument and
@@ -390,10 +426,10 @@ returns the result of the expression. It is semantically equivalent in Lua to:
390426
end
391427
<
392428
Note that "_A" receives the argument to "luaeval". Lua numbers, strings, and
393-
list, dict, and funcref userdata are converted to their Vim respective types,
394-
while Lua booleans are converted to numbers. An error is thrown if conversion
395-
of any of the remaining Lua types, including userdata other than lists, dicts,
396-
and funcrefs, is attempted.
429+
list, dict, blob, and funcref userdata are converted to their Vim respective
430+
types, while Lua booleans are converted to numbers. An error is thrown if
431+
conversion of any of the remaining Lua types, including userdata other than
432+
lists, dicts, blobs, and funcrefs, is attempted.
397433

398434
Examples: >
399435
@@ -408,7 +444,7 @@ Examples: >
408444
409445
410446
==============================================================================
411-
9. Dynamic loading *lua-dynamic*
447+
10. Dynamic loading *lua-dynamic*
412448

413449
On MS-Windows and Unix the Lua library can be loaded dynamically. The
414450
|:version| output then includes |+lua/dyn|.

0 commit comments

Comments
 (0)