Skip to content

Commit 93e61c8

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents c177a08 + 41cc038 commit 93e61c8

40 files changed

Lines changed: 1609 additions & 1210 deletions

nsis/gvim.nsi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ UninstPage instfiles
8787
Function .onInit
8888
MessageBox MB_YESNO|MB_ICONQUESTION \
8989
"This will install Vim ${VER_MAJOR}.${VER_MINOR} on your computer.$\n Continue?" \
90+
/SD IDYES \
9091
IDYES NoAbort
9192
Abort ; causes installer to quit.
9293
NoAbort:

runtime/doc/eval.txt

Lines changed: 77 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*eval.txt* For Vim version 8.0. Last change: 2017 Jun 13
1+
*eval.txt* For Vim version 8.0. Last change: 2017 Jun 25
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -4586,6 +4586,7 @@ getqflist([{what}]) *getqflist()*
45864586
returns only the items listed in {what} as a dictionary. The
45874587
following string items are supported in {what}:
45884588
context get the context stored with |setqflist()|
4589+
items quickfix list entries
45894590
nr get information for this quickfix list; zero
45904591
means the current quickfix list and '$' means
45914592
the last quickfix list
@@ -4602,6 +4603,7 @@ getqflist([{what}]) *getqflist()*
46024603

46034604
The returned dictionary contains the following entries:
46044605
context context information stored with |setqflist()|
4606+
items quickfix list entries
46054607
nr quickfix list number
46064608
title quickfix list title text
46074609
winid quickfix |window-ID| (if opened)
@@ -5466,9 +5468,9 @@ line({expr}) The result is a Number, which is the line number of the file
54665468
This autocommand jumps to the last known position in a file
54675469
just after opening it, if the '" mark is set: >
54685470
:au BufReadPost *
5469-
\ if line("'\"") > 1 && line("'\"") <= line("$") && &ft !~# 'commit'
5470-
\ | exe "normal! g`\""
5471-
\ | endif
5471+
\ if line("'\"") > 1 && line("'\"") <= line("$") && &ft !~# 'commit'
5472+
\ | exe "normal! g`\""
5473+
\ | endif
54725474
54735475
line2byte({lnum}) *line2byte()*
54745476
Return the byte count from the start of the buffer for line
@@ -5890,15 +5892,15 @@ max({expr}) Return the maximum value of all items in {expr}.
58905892
it returns the maximum of all values in the dictionary.
58915893
If {expr} is neither a list nor a dictionary, or one of the
58925894
items in {expr} cannot be used as a Number this results in
5893-
an error. An empty |List| or |Dictionary| results in zero.
5895+
an error. An empty |List| or |Dictionary| results in zero.
58945896

58955897
*min()*
58965898
min({expr}) Return the minimum value of all items in {expr}.
58975899
{expr} can be a list or a dictionary. For a dictionary,
58985900
it returns the minimum of all values in the dictionary.
58995901
If {expr} is neither a list nor a dictionary, or one of the
59005902
items in {expr} cannot be used as a Number this results in
5901-
an error. An empty |List| or |Dictionary| results in zero.
5903+
an error. An empty |List| or |Dictionary| results in zero.
59025904

59035905
*mkdir()* *E739*
59045906
mkdir({name} [, {path} [, {prot}]])
@@ -6193,8 +6195,8 @@ printf({fmt}, {expr1} ...) *printf()*
61936195
zero the decimal point is omitted. When the precision
61946196
is not specified 6 is used. A really big number
61956197
(out of range or dividing by zero) results in "inf"
6196-
or "-inf" with %f (INF or -INF with %F).
6197-
"0.0 / 0.0" results in "nan" with %f (NAN with %F).
6198+
or "-inf" with %f (INF or -INF with %F).
6199+
"0.0 / 0.0" results in "nan" with %f (NAN with %F).
61986200
Example: >
61996201
echo printf("%.2f", 12.115)
62006202
< 12.12
@@ -6998,6 +7000,8 @@ setqflist({list} [, {action}[, {what}]]) *setqflist()*
69987000
argument is ignored. The following items can be specified in
69997001
{what}:
70007002
context any Vim type can be stored as a context
7003+
items list of quickfix entries. Same as the {list}
7004+
argument.
70017005
nr list number in the quickfix stack; zero
70027006
means the current quickfix list and '$' means
70037007
the last quickfix list
@@ -7651,17 +7655,29 @@ synIDtrans({synID}) *synIDtrans()*
76517655
":highlight link" are followed.
76527656

76537657
synconcealed({lnum}, {col}) *synconcealed()*
7654-
The result is a List. The first item in the list is 0 if the
7655-
character at the position {lnum} and {col} is not part of a
7656-
concealable region, 1 if it is. The second item in the list is
7657-
a string. If the first item is 1, the second item contains the
7658-
text which will be displayed in place of the concealed text,
7659-
depending on the current setting of 'conceallevel'. The third
7660-
and final item in the list is a unique number representing the
7661-
specific syntax region matched. This allows detection of the
7662-
beginning of a new concealable region if there are two
7663-
consecutive regions with the same replacement character.
7664-
For an example use see $VIMRUNTIME/syntax/2html.vim .
7658+
The result is a List with currently three items:
7659+
1. The first item in the list is 0 if the character at the
7660+
position {lnum} and {col} is not part of a concealable
7661+
region, 1 if it is.
7662+
2. The second item in the list is a string. If the first item
7663+
is 1, the second item contains the text which will be
7664+
displayed in place of the concealed text, depending on the
7665+
current setting of 'conceallevel' and 'listchars'.
7666+
3. The third and final item in the list is a number
7667+
representing the specific syntax region matched in the
7668+
line. When the character is not concealed the value is
7669+
zero. This allows detection of the beginning of a new
7670+
concealable region if there are two consecutive regions
7671+
with the same replacement character. For an example, if
7672+
the text is "123456" and both "23" and "45" are concealed
7673+
and replace by the character "X", then:
7674+
call returns ~
7675+
synconcealed(lnum, 1) [0, '', 0]
7676+
synconcealed(lnum, 2) [1, 'X', 1]
7677+
synconcealed(lnum, 3) [1, 'X', 1]
7678+
synconcealed(lnum, 4) [1, 'X', 2]
7679+
synconcealed(lnum, 5) [1, 'X', 2]
7680+
synconcealed(lnum, 6) [0, '', 0]
76657681

76667682

76677683
synstack({lnum}, {col}) *synstack()*
@@ -7926,8 +7942,19 @@ test_override({name}, {val}) *test_override()*
79267942
name effect when {val} is non-zero ~
79277943
redraw disable the redrawing() function
79287944
char_avail disable the char_avail() function
7945+
starting reset the "starting" variable, see below
79297946
ALL clear all overrides ({val} is not used)
79307947

7948+
"starting" is to be used when a test should behave like
7949+
startup was done. Since the tests are run by sourcing a
7950+
script the "starting" variable is non-zero. This is usually a
7951+
good thing (tests run faster), but sometimes changes behavior
7952+
in a way that the test doesn't work properly.
7953+
When using: >
7954+
call test_override('starting', 1)
7955+
< The value of "starting" is saved. It is restored by: >
7956+
call test_override('starting', 0)
7957+
79317958
test_settime({expr}) *test_settime()*
79327959
Set the time Vim uses internally. Currently only used for
79337960
timestamps in the history, as they are used in viminfo, and
@@ -8348,8 +8375,8 @@ winwidth({nr}) *winwidth()*
83488375
:if winwidth(0) <= 50
83498376
: exe "normal 50\<C-W>|"
83508377
:endif
8351-
< For getting the terminal or screen size, see the 'columns'
8352-
option.
8378+
< For getting the terminal or screen size, see the 'columns'
8379+
option.
83538380

83548381

83558382
wordcount() *wordcount()*
@@ -8367,11 +8394,11 @@ wordcount() *wordcount()*
83678394
cursor_words Number of words before cursor position
83688395
(not in Visual mode)
83698396
visual_bytes Number of bytes visually selected
8370-
(only in Visual mode)
8397+
(only in Visual mode)
83718398
visual_chars Number of chars visually selected
8372-
(only in Visual mode)
8399+
(only in Visual mode)
83738400
visual_words Number of chars visually selected
8374-
(only in Visual mode)
8401+
(only in Visual mode)
83758402

83768403

83778404
*writefile()*
@@ -8719,6 +8746,9 @@ See |:verbose-cmd| for more information.
87198746
not used an error message is given. When [!] is used,
87208747
an existing function is silently replaced. Unless it
87218748
is currently being executed, that is an error.
8749+
NOTE: Use ! wisely. If used without care it can cause
8750+
an existing function to be replaced unexpectedly,
8751+
which is hard to debug.
87228752

87238753
For the {arguments} see |function-argument|.
87248754

@@ -8768,18 +8798,36 @@ See |:verbose-cmd| for more information.
87688798
implies that the effect of |:nohlsearch| is undone
87698799
when the function returns.
87708800

8771-
*:endf* *:endfunction* *E126* *E193*
8772-
:endf[unction] The end of a function definition. Must be on a line
8773-
by its own, without other commands.
8774-
8801+
*:endf* *:endfunction* *E126* *E193* *W22*
8802+
:endf[unction] [argument]
8803+
The end of a function definition. Best is to put it
8804+
on a line by its own, without [argument].
8805+
8806+
[argument] can be:
8807+
| command command to execute next
8808+
\n command command to execute next
8809+
" comment always ignored
8810+
anything else ignored, warning given when
8811+
'verbose' is non-zero
8812+
The support for a following command was added in Vim
8813+
8.0.0654, before that any argument was silently
8814+
ignored.
8815+
8816+
To be able to define a function inside an `:execute`
8817+
command, use line breaks instead of |:bar|: >
8818+
:exe "func Foo()\necho 'foo'\nendfunc"
8819+
<
87758820
*:delf* *:delfunction* *E130* *E131* *E933*
8776-
:delf[unction] {name} Delete function {name}.
8821+
:delf[unction][!] {name}
8822+
Delete function {name}.
87778823
{name} can also be a |Dictionary| entry that is a
87788824
|Funcref|: >
87798825
:delfunc dict.init
87808826
< This will remove the "init" entry from "dict". The
87818827
function is deleted if there are no more references to
87828828
it.
8829+
With the ! there is no error if the function does not
8830+
exist.
87838831
*:retu* *:return* *E133*
87848832
:retu[rn] [expr] Return from a function. When "[expr]" is given, it is
87858833
evaluated and returned as the result of the function.

runtime/filetype.vim

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
" Vim support file to detect file types
22
"
33
" Maintainer: Bram Moolenaar <[email protected]>
4-
" Last Change: 2017 Jun 12
4+
" Last Change: 2017 Jun 22
55

66
" Listen very carefully, I will say this only once
77
if exists("did_load_filetypes")
@@ -48,6 +48,9 @@ func! s:StarSetf(ft)
4848
endif
4949
endfunc
5050

51+
" Vim help file
52+
au BufNewFile,BufRead $VIMRUNTIME/doc/*.txt setf help
53+
5154
" Abaqus or Trasys
5255
au BufNewFile,BufRead *.inp call s:Check_inp()
5356

@@ -2786,7 +2789,13 @@ au BufNewFile,BufRead zsh*,zlog* call s:StarSetf('zsh')
27862789

27872790
" Plain text files, needs to be far down to not override others. This avoids
27882791
" the "conf" type being used if there is a line starting with '#'.
2789-
au BufNewFile,BufRead *.txt,*.text,README setf text
2792+
au BufNewFile,BufRead *.text,README setf text
2793+
2794+
" Help files match *.txt but should have a last line that is a modeline.
2795+
au BufNewFile,BufRead *.txt
2796+
\ if getline('$') !~ 'vim:.*ft=help'
2797+
\| setf text
2798+
\| endif
27902799

27912800

27922801
" Use the filetype detect plugins. They may overrule any of the previously

runtime/tools/unicode.vim

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
" http://www.unicode.org/Public/5.1.0/ucd/UCD.html
44
" For the other files see the header.
55
"
6+
" Might need to update the URL to the emoji-data.txt
67
" Usage: Vim -S <this-file>
78
"
89
" Author: Bram Moolenaar
@@ -382,8 +383,9 @@ let s:ambitable = []
382383
call BuildWidthTable('A', 'ambiguous')
383384

384385
" Edit the emoji text file. Requires the netrw plugin.
385-
edit http://www.unicode.org/Public/emoji/3.0/emoji-data.txt
386+
edit http://unicode.org/Public/emoji/5.0/emoji-data.txt
387+
"edit http://www.unicode.org/Public/emoji/latest/emoji-data.txt
386388

387389
" Build the emoji table. Ver. 1.0 - 6.0
388390
" Must come after the "ambiguous" table
389-
call BuildEmojiTable('; Emoji\s\+# [1-6]\.[0-9]', 'emoji')
391+
call BuildEmojiTable('; Emoji\s\+#\s\+\d\+\.\d', 'emoji')

src/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2103,7 +2103,7 @@ test1 \
21032103
test20 test21 test22 test23 test24 test25 test26 test27 test28 test29 \
21042104
test30 test31 test32 test33 test34 test36 test37 test38 test39 \
21052105
test40 test41 test42 test43 test44 test45 test48 test49 \
2106-
test50 test51 test52 test53 test54 test55 test56 test57 test58 test59 \
2106+
test50 test51 test52 test53 test54 test55 test56 test57 test59 \
21072107
test60 test64 test66 test67 test68 test69 \
21082108
test70 test72 test73 test74 test75 test77 test78 test79 \
21092109
test80 test82 test83 test84 test85 test86 test87 test88 \

src/edit.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4322,9 +4322,17 @@ ins_compl_get_exp(pos_T *ini)
43224322
{
43234323
ins_buf = curbuf;
43244324
first_match_pos = *ini;
4325-
/* So that ^N can match word immediately after cursor */
4326-
if (ctrl_x_mode == 0)
4327-
dec(&first_match_pos);
4325+
/* Move the cursor back one character so that ^N can match the
4326+
* word immediately after the cursor. */
4327+
if (ctrl_x_mode == 0 && dec(&first_match_pos) < 0)
4328+
{
4329+
/* Move the cursor to after the last character in the
4330+
* buffer, so that word at start of buffer is found
4331+
* correctly. */
4332+
first_match_pos.lnum = ins_buf->b_ml.ml_line_count;
4333+
first_match_pos.col =
4334+
(colnr_T)STRLEN(ml_get(first_match_pos.lnum));
4335+
}
43284336
last_match_pos = first_match_pos;
43294337
type = 0;
43304338

src/evalfunc.c

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3191,7 +3191,11 @@ f_feedkeys(typval_T *argvars, typval_T *rettv UNUSED)
31913191
ins_typebuf(keys_esc, (remap ? REMAP_YES : REMAP_NONE),
31923192
insert ? 0 : typebuf.tb_len, !typed, FALSE);
31933193
vim_free(keys_esc);
3194-
if (vgetc_busy)
3194+
if (vgetc_busy
3195+
#ifdef FEAT_TIMERS
3196+
|| timer_busy
3197+
#endif
3198+
)
31953199
typebuf_was_filled = TRUE;
31963200
if (execute)
31973201
{
@@ -11868,8 +11872,8 @@ f_synconcealed(typval_T *argvars UNUSED, typval_T *rettv)
1186811872
if ((syntax_flags & HL_CONCEAL) && curwin->w_p_cole < 3)
1186911873
{
1187011874
cchar = syn_get_sub_char();
11871-
if (cchar == NUL && curwin->w_p_cole == 1 && lcs_conceal != NUL)
11872-
cchar = lcs_conceal;
11875+
if (cchar == NUL && curwin->w_p_cole == 1)
11876+
cchar = (lcs_conceal == NUL) ? ' ' : lcs_conceal;
1187311877
if (cchar != NUL)
1187411878
{
1187511879
# ifdef FEAT_MBYTE
@@ -12421,6 +12425,7 @@ f_test_override(typval_T *argvars, typval_T *rettv UNUSED)
1242112425
{
1242212426
char_u *name = (char_u *)"";
1242312427
int val;
12428+
static int save_starting = -1;
1242412429

1242512430
if (argvars[0].v_type != VAR_STRING
1242612431
|| (argvars[1].v_type) != VAR_NUMBER)
@@ -12434,10 +12439,29 @@ f_test_override(typval_T *argvars, typval_T *rettv UNUSED)
1243412439
disable_redraw_for_testing = val;
1243512440
else if (STRCMP(name, (char_u *)"char_avail") == 0)
1243612441
disable_char_avail_for_testing = val;
12442+
else if (STRCMP(name, (char_u *)"starting") == 0)
12443+
{
12444+
if (val)
12445+
{
12446+
if (save_starting < 0)
12447+
save_starting = starting;
12448+
starting = 0;
12449+
}
12450+
else
12451+
{
12452+
starting = save_starting;
12453+
save_starting = -1;
12454+
}
12455+
}
1243712456
else if (STRCMP(name, (char_u *)"ALL") == 0)
1243812457
{
1243912458
disable_char_avail_for_testing = FALSE;
1244012459
disable_redraw_for_testing = FALSE;
12460+
if (save_starting >= 0)
12461+
{
12462+
starting = save_starting;
12463+
save_starting = -1;
12464+
}
1244112465
}
1244212466
else
1244312467
EMSG2(_(e_invarg2), name);

src/ex_cmds.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6832,8 +6832,15 @@ fix_help_buffer(void)
68326832
char_u *rt;
68336833
int mustfree;
68346834

6835-
/* set filetype to "help". */
6836-
set_option_value((char_u *)"ft", 0L, (char_u *)"help", OPT_LOCAL);
6835+
#ifdef FEAT_AUTOCMD
6836+
/* Set filetype to "help" if still needed. */
6837+
if (STRCMP(curbuf->b_p_ft, "help") != 0)
6838+
{
6839+
++curbuf_lock;
6840+
set_option_value((char_u *)"ft", 0L, (char_u *)"help", OPT_LOCAL);
6841+
--curbuf_lock;
6842+
}
6843+
#endif
68376844

68386845
#ifdef FEAT_SYN_HL
68396846
if (!syntax_present(curwin))

src/ex_cmds.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ EX(CMD_delcommand, "delcommand", ex_delcommand,
426426
NEEDARG|WORD1|TRLBAR|CMDWIN,
427427
ADDR_LINES),
428428
EX(CMD_delfunction, "delfunction", ex_delfunction,
429-
NEEDARG|WORD1|CMDWIN,
429+
BANG|NEEDARG|WORD1|CMDWIN,
430430
ADDR_LINES),
431431
EX(CMD_display, "display", ex_display,
432432
EXTRA|NOTRLCOM|TRLBAR|SBOXOK|CMDWIN,

0 commit comments

Comments
 (0)