Skip to content

Commit c877592

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents ce8eda7 + 5f91e74 commit c877592

Some content is hidden

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

83 files changed

+1665
-282
lines changed

Filelist

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ SRC_ALL = \
1313
.hgignore \
1414
.lgtm.yml \
1515
.travis.yml \
16-
appveyor.yml \
16+
.appveyor.yml \
17+
.codecov.yml \
1718
ci/appveyor.bat \
1819
ci/build-snd-dummy.sh \
1920
ci/config.mk*.sed \

runtime/doc/change.txt

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*change.txt* For Vim version 8.2. Last change: 2021 Jan 21
1+
*change.txt* For Vim version 8.2. Last change: 2021 Mar 01
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -649,6 +649,8 @@ For other systems the tmpnam() library function is used.
649649
The space between `:substitute` and the 'c', 'g',
650650
'i', 'I' and 'r' flags isn't required, but in scripts
651651
it's a good idea to keep it to avoid confusion.
652+
Also see the two and three letter commands to repeat
653+
:substitute below |:substitute-repeat|.
652654

653655
:[range]~[&][flags] [count] *:~*
654656
Repeat last substitute with same substitute string
@@ -877,20 +879,26 @@ either the first or second pattern in parentheses did not match, so either
877879
*:sge* *:sgi* *:sgI* *:sgl* *:sgn* *:sgp* *:sgr* *:sI* *:si*
878880
*:sic* *:sIc* *:sie* *:sIe* *:sIg* *:sIl* *:sin* *:sIn* *:sIp*
879881
*:sip* *:sIr* *:sir* *:sr* *:src* *:srg* *:sri* *:srI* *:srl*
880-
*:srn* *:srp*
882+
*:srn* *:srp* *:substitute-repeat*
881883
2-letter and 3-letter :substitute commands ~
882884

885+
These commands repeat the previous `:substitute` command with the given flags.
886+
The first letter is always "s", followed by one or two of the possible flag
887+
characters. For example `:sce` works like `:s///ce`. The table lists the
888+
possible combinations, not all flags are possible, because the command is
889+
short for another command.
890+
883891
List of :substitute commands
884892
| c e g i I n p l r
885-
| c :sc :sce :scg :sci :scI :scn :scp :scl ---
893+
| c :sc :sce :scg :sci :scI :scn :scp :scl
886894
| e
887895
| g :sgc :sge :sg :sgi :sgI :sgn :sgp :sgl :sgr
888-
| i :sic :sie --- :si :siI :sin :sip --- :sir
896+
| i :sic :sie :si :siI :sin :sip :sir
889897
| I :sIc :sIe :sIg :sIi :sI :sIn :sIp :sIl :sIr
890898
| n
891899
| p
892900
| l
893-
| r :src --- :srg :sri :srI :srn :srp :srl :sr
901+
| r :src :srg :sri :srI :srn :srp :srl :sr
894902

895903
Exceptions:
896904
:scr is `:scriptnames`

runtime/doc/eval.txt

Lines changed: 45 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*eval.txt* For Vim version 8.2. Last change: 2021 Feb 10
1+
*eval.txt* For Vim version 8.2. Last change: 2021 Mar 10
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1187,7 +1187,8 @@ byte under the cursor: >
11871187

11881188
In Vim9 script:
11891189
If expr8 is a String this results in a String that contains the expr1'th
1190-
single character from expr8. To use byte indexes use |strpart()|.
1190+
single character (including any composing characters) from expr8. To use byte
1191+
indexes use |strpart()|.
11911192

11921193
Index zero gives the first byte or character. Careful: text column numbers
11931194
start with one!
@@ -1217,8 +1218,9 @@ In legacy Vim script the indexes are byte indexes. This doesn't recognize
12171218
multibyte encodings, see |byteidx()| for computing the indexes. If expr8 is
12181219
a Number it is first converted to a String.
12191220

1220-
In Vim9 script the indexes are character indexes. To use byte indexes use
1221-
|strpart()|.
1221+
In Vim9 script the indexes are character indexes and include composing
1222+
characters. To use byte indexes use |strpart()|. To use character indexes
1223+
without including composing characters use |strcharpart()|.
12221224

12231225
The item at index expr1b is included, it is inclusive. For an exclusive index
12241226
use the |slice()| function.
@@ -2935,10 +2937,11 @@ str2list({expr} [, {utf8}]) List convert each character of {expr} to
29352937
ASCII/UTF8 value
29362938
str2nr({expr} [, {base} [, {quoted}]])
29372939
Number convert String to Number
2938-
strcharpart({str}, {start} [, {len}])
2940+
strcharlen({expr}) Number character length of the String {expr}
2941+
strcharpart({str}, {start} [, {len} [, {skipcc}]])
29392942
String {len} characters of {str} at
29402943
character {start}
2941-
strchars({expr} [, {skipcc}]) Number character length of the String {expr}
2944+
strchars({expr} [, {skipcc}]) Number character count of the String {expr}
29422945
strdisplaywidth({expr} [, {col}]) Number display length of the String {expr}
29432946
strftime({format} [, {time}]) String format time with a specified format
29442947
strgetchar({str}, {index}) Number get char {index} from {str}
@@ -5312,6 +5315,9 @@ getcharpos({expr})
53125315
Get the position for {expr}. Same as |getpos()| but the column
53135316
number in the returned List is a character index instead of
53145317
a byte index.
5318+
If |getpos()| returns a very large column number, such as
5319+
2147483647, then getcharpos() will return the character index
5320+
of the last character.
53155321

53165322
Example:
53175323
With the cursor on '세' in line 5 with text "여보세요": >
@@ -5791,6 +5797,8 @@ getpos({expr}) Get the position for {expr}. For possible values of {expr}
57915797
The column number in the returned List is the byte position
57925798
within the line. To get the character position in the line,
57935799
use |getcharpos()|
5800+
The column number can be very large, e.g. 2147483647, in which
5801+
case it means "after the end of the line".
57945802
This can be used to save and restore the position of a mark: >
57955803
let save_a_mark = getpos("'a")
57965804
...
@@ -7462,7 +7470,8 @@ matchaddpos({group}, {pos} [, {priority} [, {id} [, {dict}]]])
74627470
to be used when fast match additions and deletions are
74637471
required, for example to highlight matching parentheses.
74647472

7465-
The list {pos} can contain one of these items:
7473+
{pos} is a list of positions. Each position can be one of
7474+
these:
74667475
- A number. This whole line will be highlighted. The first
74677476
line has number 1.
74687477
- A list with one number, e.g., [23]. The whole line with this
@@ -7475,7 +7484,7 @@ matchaddpos({group}, {pos} [, {priority} [, {id} [, {dict}]]])
74757484
- A list with three numbers, e.g., [23, 11, 3]. As above, but
74767485
the third number gives the length of the highlight in bytes.
74777486

7478-
The maximum number of positions is 8.
7487+
The maximum number of positions in {pos} is 8.
74797488

74807489
Example: >
74817490
:highlight MyGroup ctermbg=green guibg=green
@@ -7484,8 +7493,7 @@ matchaddpos({group}, {pos} [, {priority} [, {id} [, {dict}]]])
74847493
:call matchdelete(m)
74857494

74867495
< Matches added by |matchaddpos()| are returned by
7487-
|getmatches()| with an entry "pos1", "pos2", etc., with the
7488-
value a list like the {pos} item.
7496+
|getmatches()|.
74897497

74907498
Can also be used as a |method|: >
74917499
GetGroup()->matchaddpos([23, 11])
@@ -9925,7 +9933,7 @@ slice({expr}, {start} [, {end}]) *slice()*
99259933
Similar to using a |slice| "expr[start : end]", but "end" is
99269934
used exclusive. And for a string the indexes are used as
99279935
character indexes instead of byte indexes, like in
9928-
|vim9script|.
9936+
|vim9script|. Also, composing characters are not counted.
99299937
When {end} is omitted the slice continues to the last item.
99309938
When {end} is -1 the last item is omitted.
99319939

@@ -10283,23 +10291,44 @@ str2nr({expr} [, {base} [, {quoted}]]) *str2nr()*
1028310291
Can also be used as a |method|: >
1028410292
GetText()->str2nr()
1028510293

10286-
strcharpart({src}, {start} [, {len}]) *strcharpart()*
10294+
10295+
strcharlen({expr}) *strcharlen()*
10296+
The result is a Number, which is the number of characters
10297+
in String {expr}. Composing characters are ignored.
10298+
|strchars()| can count the number of characters, counting
10299+
composing characters separately.
10300+
10301+
Also see |strlen()|, |strdisplaywidth()| and |strwidth()|.
10302+
10303+
Can also be used as a |method|: >
10304+
GetText()->strcharlen()
10305+
10306+
10307+
strcharpart({src}, {start} [, {len} [, {skipcc}]]) *strcharpart()*
1028710308
Like |strpart()| but using character index and length instead
1028810309
of byte index and length.
10310+
When {skipcc} is omitted or zero, composing characters are
10311+
counted separately.
10312+
When {skipcc} set to 1, Composing characters are ignored,
10313+
similar to |slice()|.
1028910314
When a character index is used where a character does not
10290-
exist it is assumed to be one character. For example: >
10315+
exist it is omitted and counted as one character. For
10316+
example: >
1029110317
strcharpart('abc', -1, 2)
1029210318
< results in 'a'.
1029310319

1029410320
Can also be used as a |method|: >
1029510321
GetText()->strcharpart(5)
1029610322

10323+
1029710324
strchars({expr} [, {skipcc}]) *strchars()*
1029810325
The result is a Number, which is the number of characters
1029910326
in String {expr}.
1030010327
When {skipcc} is omitted or zero, composing characters are
1030110328
counted separately.
1030210329
When {skipcc} set to 1, Composing characters are ignored.
10330+
|strcharlen()| always does this.
10331+
1030310332
Also see |strlen()|, |strdisplaywidth()| and |strwidth()|.
1030410333

1030510334
{skipcc} is only available after 7.4.755. For backward
@@ -13159,7 +13188,7 @@ text...
1315913188
Cannot be followed by a comment.
1316013189
Examples: >
1316113190
:execute "buffer" nextbuf
13162-
:execute "normal" count . "w"
13191+
:execute "normal" count .. "w"
1316313192
<
1316413193
":execute" can be used to append a command to commands
1316513194
that don't accept a '|'. Example: >
@@ -13175,8 +13204,8 @@ text...
1317513204
file names. The |fnameescape()| function can be used
1317613205
for Vim commands, |shellescape()| for |:!| commands.
1317713206
Examples: >
13178-
:execute "e " . fnameescape(filename)
13179-
:execute "!ls " . shellescape(filename, 1)
13207+
:execute "e " .. fnameescape(filename)
13208+
:execute "!ls " .. shellescape(filename, 1)
1318013209
<
1318113210
Note: The executed string may be any command-line, but
1318213211
starting or ending "if", "while" and "for" does not

runtime/doc/filetype.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*filetype.txt* For Vim version 8.2. Last change: 2021 Jan 21
1+
*filetype.txt* For Vim version 8.2. Last change: 2021 Mar 11
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -628,6 +628,13 @@ For fish, add to the config file
628628

629629
set -x MANPAGER "vim -M +MANPAGER -"
630630

631+
632+
MARKDOWN *ft-markdown-plugin*
633+
634+
To enable folding use this: >
635+
let g:markdown_folding = 1
636+
<
637+
631638
PDF *ft-pdf-plugin*
632639

633640
Two maps, <C-]> and <C-T>, are provided to simulate a tag stack for navigating

runtime/doc/map.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,20 @@ input. Example: >
263263
endfunc
264264
nnoremap <expr> <F3> <Sid>OpenPopup()
265265
266+
Also, keep in mind that the expression may be evaluated when looking for
267+
typeahead, before the previous command has been executed. For example: >
268+
func StoreColumn()
269+
let g:column = col('.')
270+
return 'x'
271+
endfunc
272+
nnoremap <expr> x StoreColumn()
273+
nmap ! f!x
274+
You will notice that g:column has the value from before executing "fx",
275+
because "z" is evaluated before "fx" is executed.
276+
This can be solved by inserting <Ignore> before the character that is
277+
expression-mapped: >
278+
nmap ! f!<Ignore>x
279+
266280
Be very careful about side effects! The expression is evaluated while
267281
obtaining characters, you may very well make the command dysfunctional.
268282
For this reason the following is blocked:

runtime/doc/repeat.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -677,9 +677,9 @@ Your directory layout would be like this:
677677
opt/fooextra/doc/tags " help tags
678678

679679
This allows for the user to do: >
680-
mkdir ~/.vim/pack/myfoobar
681-
cd ~/.vim/pack/myfoobar
682-
git clone https://github.com/you/foobar.git
680+
mkdir ~/.vim/pack
681+
cd ~/.vim/pack
682+
git clone https://github.com/you/foobar.git myfoobar
683683
684684
Here "myfoobar" is a name that the user can choose, the only condition is that
685685
it differs from other packages.

runtime/doc/sign.txt

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*sign.txt* For Vim version 8.2. Last change: 2020 Oct 28
1+
*sign.txt* For Vim version 8.2. Last change: 2021 Mar 07
22

33

44
VIM REFERENCE MANUAL by Gordon Prieur
@@ -146,6 +146,9 @@ See |sign_define()| for the equivalent Vim script function.
146146
texthl={group}
147147
Highlighting group used for the text item.
148148

149+
Example: >
150+
:sign define MySign text=>> texthl=Search linehl=DiffText
151+
<
149152

150153
DELETING A SIGN *:sign-undefine* *E155*
151154

@@ -155,7 +158,9 @@ See |sign_undefine()| for the equivalent Vim script function.
155158
Deletes a previously defined sign. If signs with this {name}
156159
are still placed this will cause trouble.
157160

158-
161+
Example: >
162+
:sign undefine MySign
163+
<
159164

160165
LISTING SIGNS *:sign-list* *E156*
161166

@@ -209,6 +214,10 @@ See |sign_place()| for the equivalent Vim script function.
209214
Same, but use buffer {nr}. If the buffer argument is not
210215
given, place the sign in the current buffer.
211216

217+
Example: >
218+
:sign place 10 line=99 name=sign3
219+
:sign place 10 line=99 name=sign3 buffer=3
220+
<
212221
*E885*
213222
:sign place {id} name={name} file={fname}
214223
Change the placed sign {id} in file {fname} to use the defined
@@ -221,10 +230,17 @@ See |sign_place()| for the equivalent Vim script function.
221230
"priority={prio}" attribute can be used to change the priority
222231
of an existing sign.
223232

233+
Example: >
234+
:sign place 23 name=sign1 file=/path/to/edit.py
235+
<
224236
:sign place {id} name={name} [buffer={nr}]
225237
Same, but use buffer {nr}. If the buffer argument is not
226238
given, use the current buffer.
227239

240+
Example: >
241+
:sign place 23 name=sign1
242+
:sign place 23 name=sign1 buffer=7
243+
<
228244

229245
REMOVING SIGNS *:sign-unplace* *E159*
230246

runtime/doc/syntax.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*syntax.txt* For Vim version 8.2. Last change: 2021 Jan 21
1+
*syntax.txt* For Vim version 8.2. Last change: 2021 Mar 06
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1741,8 +1741,8 @@ The coloring scheme for tags in the HTML file works as follows.
17411741

17421742
The <> of opening tags are colored differently than the </> of a closing tag.
17431743
This is on purpose! For opening tags the 'Function' color is used, while for
1744-
closing tags the 'Type' color is used (See syntax.vim to check how those are
1745-
defined for you)
1744+
closing tags the 'Identifier' color is used (See syntax.vim to check how those
1745+
are defined for you)
17461746

17471747
Known tag names are colored the same way as statements in C. Unknown tag
17481748
names are colored with the same color as the <> or </> respectively which
@@ -4676,7 +4676,7 @@ matches, nextgroup, etc. But there are a few differences:
46764676
- A line continuation pattern can be given. It is used to decide which group
46774677
of lines need to be searched like they were one line. This means that the
46784678
search for a match with the specified items starts in the first of the
4679-
consecutive that contain the continuation pattern.
4679+
consecutive lines that contain the continuation pattern.
46804680
- When using "nextgroup" or "contains", this only works within one line (or
46814681
group of continued lines).
46824682
- When using a region, it must start and end in the same line (or group of

runtime/doc/tags

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3218,6 +3218,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
32183218
:stselect tagsrch.txt /*:stselect*
32193219
:su change.txt /*:su*
32203220
:substitute change.txt /*:substitute*
3221+
:substitute-repeat change.txt /*:substitute-repeat*
32213222
:sun windows.txt /*:sun*
32223223
:sunhide windows.txt /*:sunhide*
32233224
:sunm map.txt /*:sunm*
@@ -6667,6 +6668,7 @@ ft-mail.vim syntax.txt /*ft-mail.vim*
66676668
ft-make-syntax syntax.txt /*ft-make-syntax*
66686669
ft-man-plugin filetype.txt /*ft-man-plugin*
66696670
ft-maple-syntax syntax.txt /*ft-maple-syntax*
6671+
ft-markdown-plugin filetype.txt /*ft-markdown-plugin*
66706672
ft-masm-syntax syntax.txt /*ft-masm-syntax*
66716673
ft-mathematica-syntax syntax.txt /*ft-mathematica-syntax*
66726674
ft-matlab-indent indent.txt /*ft-matlab-indent*

runtime/doc/testing.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*testing.txt* For Vim version 8.2. Last change: 2020 Dec 12
1+
*testing.txt* For Vim version 8.2. Last change: 2021 Mar 10
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -168,6 +168,7 @@ test_override({name}, {val}) *test_override()*
168168
wait time of up to 3 seconds for messages
169169
term_props reset all terminal properties when the version
170170
string is detected
171+
uptime overrules sysinfo.uptime
171172
ALL clear all overrides ({val} is not used)
172173

173174
"starting" is to be used when a test should behave like

0 commit comments

Comments
 (0)