Skip to content

Commit be7e877

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents 63488e8 + e0ebeda commit be7e877

65 files changed

Lines changed: 1532 additions & 655 deletions

Some content is hidden

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

runtime/doc/autocmd.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,7 @@ Name triggered by ~
382382
info
383383

384384
|User| to be used in combination with ":doautocmd"
385+
|SigUSR1| after the SIGUSR1 signal has been detected
385386

386387

387388
The alphabetical list of autocommand events: *autocmd-events-abc*
@@ -1165,6 +1166,7 @@ TextYankPost After text has been yanked or deleted in the
11651166
It is not allowed to change the buffer text,
11661167
see |textlock|.
11671168
{only when compiled with the +eval feature}
1169+
11681170
*User*
11691171
User Never executed automatically. To be used for
11701172
autocommands that are only executed with
@@ -1173,6 +1175,15 @@ User Never executed automatically. To be used for
11731175
used while there are no matching autocommands,
11741176
you will get an error. If you don't want
11751177
that, define a dummy autocommand yourself.
1178+
1179+
*SigUSR1*
1180+
SigUSR1 After the SIGUSR1 signal has been detected.
1181+
Could be used if other ways of notifying Vim
1182+
are not feasible. E.g. to check for the
1183+
result of a build that takes a long time, or
1184+
when a motion sensor is triggered.
1185+
{only on Unix}
1186+
11761187
*UserGettingBored*
11771188
UserGettingBored When the user presses the same key 42 times.
11781189
Just kidding! :-)

runtime/doc/eval.txt

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2463,6 +2463,7 @@ finddir({name} [, {path} [, {count}]])
24632463
String find directory {name} in {path}
24642464
findfile({name} [, {path} [, {count}]])
24652465
String find file {name} in {path}
2466+
flatten({list} [, {maxdepth}]) List flatten {list} up to {maxdepth} levels
24662467
float2nr({expr}) Number convert Float {expr} to a Number
24672468
floor({expr}) Float round {expr} down
24682469
fmod({expr1}, {expr2}) Float remainder of {expr1} / {expr2}
@@ -4526,6 +4527,25 @@ findfile({name} [, {path} [, {count}]]) *findfile()*
45264527
Can also be used as a |method|: >
45274528
GetName()->findfile()
45284529

4530+
flatten({list} [, {maxdepth}]) *flatten()*
4531+
Flatten {list} up to {maxdepth} levels. Without {maxdepth}
4532+
the result is a |List| without nesting, as if {maxdepth} is
4533+
a very large number.
4534+
The {list} is changed in place, make a copy first if you do
4535+
not want that.
4536+
*E964*
4537+
{maxdepth} means how deep in nested lists changes are made.
4538+
{list} is not modified when {maxdepth} is 0.
4539+
{maxdepth} must be positive number.
4540+
4541+
If there is an error the number zero is returned.
4542+
4543+
Example: >
4544+
:echo flatten([1, [2, [3, 4]], 5])
4545+
< [1, 2, 3, 4, 5] >
4546+
:echo flatten([1, [2, [3, 4]], 5], 1)
4547+
< [1, 2, [3, 4], 5]
4548+
45294549
float2nr({expr}) *float2nr()*
45304550
Convert {expr} to a Number by omitting the part after the
45314551
decimal point.
@@ -9529,9 +9549,8 @@ spellbadword([{sentence}])
95299549
echo spellbadword("the quik brown fox")
95309550
< ['quik', 'bad'] ~
95319551

9532-
The spelling information for the current window is used. The
9533-
'spell' option must be set and the value of 'spelllang' is
9534-
used.
9552+
The spelling information for the current window and the value
9553+
of 'spelllang' are used.
95359554

95369555
Can also be used as a |method|: >
95379556
GetText()->spellbadword()
@@ -9556,8 +9575,7 @@ spellsuggest({word} [, {max} [, {capital}]])
95569575
although it may appear capitalized.
95579576

95589577
The spelling information for the current window is used. The
9559-
'spell' option must be set and the values of 'spelllang' and
9560-
'spellsuggest' are used.
9578+
values of 'spelllang' and 'spellsuggest' are used.
95619579

95629580
Can also be used as a |method|: >
95639581
GetWord()->spellsuggest()

runtime/doc/options.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7254,6 +7254,16 @@ A jump table for the options with a short description can be found at |Q_op|.
72547254
up to the first character that is not an ASCII letter or number and
72557255
not a dash. Also see |set-spc-auto|.
72567256

7257+
*'spelloptions'* *'spo'*
7258+
'spelloptions' 'spo' string (default "")
7259+
local to buffer
7260+
{not available when compiled without the |+syntax|
7261+
feature}
7262+
A comma separated list of options for spell checking:
7263+
camel When a word is CamelCased, assume "Cased" is a
7264+
separate word: every upper-case character in a word
7265+
that comes after a lower case character indicates the
7266+
start of a new word.
72577267

72587268
*'spellsuggest'* *'sps'*
72597269
'spellsuggest' 'sps' string (default "best")

runtime/doc/quickfix.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1953,6 +1953,9 @@ following fields:
19531953

19541954
quickfix set to 1 when called for a quickfix list and 0 when called for
19551955
a location list.
1956+
winid for a location list, set to the id of the window with the
1957+
location list. For a quickfix list, set to 0. Can be used in
1958+
getloclist() to get the location list entry.
19561959
id quickfix or location list identifier
19571960
idx index of the entry in the quickfix or location list
19581961

runtime/doc/spell.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,9 @@ When there is a line break right after a sentence the highlighting of the next
215215
line may be postponed. Use |CTRL-L| when needed. Also see |set-spc-auto| for
216216
how it can be set automatically when 'spelllang' is set.
217217

218+
The 'spelloptions' option has a few more flags that influence the way spell
219+
checking works.
220+
218221
Vim counts the number of times a good word is encountered. This is used to
219222
sort the suggestions: words that have been seen before get a small bonus,
220223
words that have been seen often get a bigger bonus. The COMMON item in the

runtime/doc/usr_41.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,7 @@ List manipulation: *list-functions*
650650
min() minimum value in a List
651651
count() count number of times a value appears in a List
652652
repeat() repeat a List multiple times
653+
flatten() flatten a List
653654

654655
Dictionary manipulation: *dict-functions*
655656
get() get an entry without an error for a wrong key

runtime/filetype.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ au BufNewFile,BufRead *.desc setf desc
462462
au BufNewFile,BufRead *.d call dist#ft#DtraceCheck()
463463

464464
" Desktop files
465-
au BufNewFile,BufRead *.desktop,.directory setf desktop
465+
au BufNewFile,BufRead *.desktop,*.directory setf desktop
466466

467467
" Dict config
468468
au BufNewFile,BufRead dict.conf,.dictrc setf dictconf

src/autocmd.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ static struct event_name
162162
{"SessionLoadPost", EVENT_SESSIONLOADPOST},
163163
{"ShellCmdPost", EVENT_SHELLCMDPOST},
164164
{"ShellFilterPost", EVENT_SHELLFILTERPOST},
165+
{"SigUSR1", EVENT_SIGUSR1},
165166
{"SourceCmd", EVENT_SOURCECMD},
166167
{"SourcePre", EVENT_SOURCEPRE},
167168
{"SourcePost", EVENT_SOURCEPOST},

src/buffer.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2291,6 +2291,7 @@ free_buf_options(
22912291
vim_regfree(buf->b_s.b_cap_prog);
22922292
buf->b_s.b_cap_prog = NULL;
22932293
clear_string_option(&buf->b_s.b_p_spl);
2294+
clear_string_option(&buf->b_s.b_p_spo);
22942295
#endif
22952296
#ifdef FEAT_SEARCHPATH
22962297
clear_string_option(&buf->b_p_sua);

src/charset.c

Lines changed: 35 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -499,18 +499,24 @@ str_foldcase(
499499
* Also doesn't work for the first byte of a multi-byte, "c" must be a
500500
* character!
501501
*/
502-
static char_u transchar_buf[7];
502+
static char_u transchar_charbuf[7];
503503

504504
char_u *
505505
transchar(int c)
506+
{
507+
return transchar_buf(curbuf, c);
508+
}
509+
510+
char_u *
511+
transchar_buf(buf_T *buf, int c)
506512
{
507513
int i;
508514

509515
i = 0;
510516
if (IS_SPECIAL(c)) // special key code, display as ~@ char
511517
{
512-
transchar_buf[0] = '~';
513-
transchar_buf[1] = '@';
518+
transchar_charbuf[0] = '~';
519+
transchar_charbuf[1] = '@';
514520
i = 2;
515521
c = K_SECOND(c);
516522
}
@@ -524,12 +530,12 @@ transchar(int c)
524530
)) || (c < 256 && vim_isprintc_strict(c)))
525531
{
526532
// printable character
527-
transchar_buf[i] = c;
528-
transchar_buf[i + 1] = NUL;
533+
transchar_charbuf[i] = c;
534+
transchar_charbuf[i + 1] = NUL;
529535
}
530536
else
531-
transchar_nonprint(transchar_buf + i, c);
532-
return transchar_buf;
537+
transchar_nonprint(buf, transchar_charbuf + i, c);
538+
return transchar_charbuf;
533539
}
534540

535541
/*
@@ -541,27 +547,27 @@ transchar_byte(int c)
541547
{
542548
if (enc_utf8 && c >= 0x80)
543549
{
544-
transchar_nonprint(transchar_buf, c);
545-
return transchar_buf;
550+
transchar_nonprint(curbuf, transchar_charbuf, c);
551+
return transchar_charbuf;
546552
}
547553
return transchar(c);
548554
}
549555

550556
/*
551557
* Convert non-printable character to two or more printable characters in
552-
* "buf[]". "buf" needs to be able to hold five bytes.
558+
* "buf[]". "charbuf" needs to be able to hold five bytes.
553559
* Does NOT work for multi-byte characters, c must be <= 255.
554560
*/
555561
void
556-
transchar_nonprint(char_u *buf, int c)
562+
transchar_nonprint(buf_T *buf, char_u *charbuf, int c)
557563
{
558564
if (c == NL)
559565
c = NUL; // we use newline in place of a NUL
560-
else if (c == CAR && get_fileformat(curbuf) == EOL_MAC)
566+
else if (c == CAR && get_fileformat(buf) == EOL_MAC)
561567
c = NL; // we use CR in place of NL in this case
562568

563569
if (dy_flags & DY_UHEX) // 'display' has "uhex"
564-
transchar_hex(buf, c);
570+
transchar_hex(charbuf, c);
565571

566572
#ifdef EBCDIC
567573
// For EBCDIC only the characters 0-63 and 255 are not printable
@@ -570,35 +576,35 @@ transchar_nonprint(char_u *buf, int c)
570576
else if (c <= 0x7f) // 0x00 - 0x1f and 0x7f
571577
#endif
572578
{
573-
buf[0] = '^';
579+
charbuf[0] = '^';
574580
#ifdef EBCDIC
575581
if (c == DEL)
576-
buf[1] = '?'; // DEL displayed as ^?
582+
charbuf[1] = '?'; // DEL displayed as ^?
577583
else
578-
buf[1] = CtrlChar(c);
584+
charbuf[1] = CtrlChar(c);
579585
#else
580-
buf[1] = c ^ 0x40; // DEL displayed as ^?
586+
charbuf[1] = c ^ 0x40; // DEL displayed as ^?
581587
#endif
582588

583-
buf[2] = NUL;
589+
charbuf[2] = NUL;
584590
}
585591
else if (enc_utf8 && c >= 0x80)
586592
{
587-
transchar_hex(buf, c);
593+
transchar_hex(charbuf, c);
588594
}
589595
#ifndef EBCDIC
590596
else if (c >= ' ' + 0x80 && c <= '~' + 0x80) // 0xa0 - 0xfe
591597
{
592-
buf[0] = '|';
593-
buf[1] = c - 0x80;
594-
buf[2] = NUL;
598+
charbuf[0] = '|';
599+
charbuf[1] = c - 0x80;
600+
charbuf[2] = NUL;
595601
}
596602
#else
597603
else if (c < 64)
598604
{
599-
buf[0] = '~';
600-
buf[1] = MetaChar(c);
601-
buf[2] = NUL;
605+
charbuf[0] = '~';
606+
charbuf[1] = MetaChar(c);
607+
charbuf[2] = NUL;
602608
}
603609
#endif
604610
else // 0x80 - 0x9f and 0xff
@@ -607,13 +613,13 @@ transchar_nonprint(char_u *buf, int c)
607613
* TODO: EBCDIC I don't know what to do with this chars, so I display
608614
* them as '~?' for now
609615
*/
610-
buf[0] = '~';
616+
charbuf[0] = '~';
611617
#ifdef EBCDIC
612-
buf[1] = '?'; // 0xff displayed as ~?
618+
charbuf[1] = '?'; // 0xff displayed as ~?
613619
#else
614-
buf[1] = (c - 0x80) ^ 0x40; // 0xff displayed as ~?
620+
charbuf[1] = (c - 0x80) ^ 0x40; // 0xff displayed as ~?
615621
#endif
616-
buf[2] = NUL;
622+
charbuf[2] = NUL;
617623
}
618624
}
619625

0 commit comments

Comments
 (0)