docs(pattern.txt): cherry-pick latests changes from Vim runtime updates

Update runtime files
53f7fccc94

Update runtime files
2286304cdb

Update runtime files
2f0936cb9a

Update runtime files.
a2baa73d1d
This commit is contained in:
zeertzjq
2022-03-19 17:48:20 +08:00
parent 1bbe8ec282
commit b2819eec26

View File

@@ -914,18 +914,18 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on):
becomes invalid. Vim doesn't automatically update the matches. becomes invalid. Vim doesn't automatically update the matches.
Similar to moving the cursor for "\%#" |/\%#|. Similar to moving the cursor for "\%#" |/\%#|.
*/\%l* */\%>l* */\%<l* *E951* */\%l* */\%>l* */\%<l* *E951* *E1204*
\%23l Matches in a specific line. \%23l Matches in a specific line.
\%<23l Matches above a specific line (lower line number). \%<23l Matches above a specific line (lower line number).
\%>23l Matches below a specific line (higher line number). \%>23l Matches below a specific line (higher line number).
\%.l Matches at the cursor line. \%.l Matches at the cursor line.
\%<.l Matches above the cursor line. \%<.l Matches above the cursor line.
\%>.l Matches below the cursor line. \%>.l Matches below the cursor line.
These three can be used to match specific lines in a buffer. The "23" These six can be used to match specific lines in a buffer. The "23"
can be any line number. The first line is 1. can be any line number. The first line is 1.
WARNING: When inserting or deleting lines Vim does not automatically WARNING: When inserting or deleting lines Vim does not automatically
update the matches. This means Syntax highlighting quickly becomes update the matches. This means Syntax highlighting quickly becomes
wrong. Also when refering to the cursor position (".") and wrong. Also when referring to the cursor position (".") and
the cursor moves the display isn't updated for this change. An update the cursor moves the display isn't updated for this change. An update
is done when using the |CTRL-L| command (the whole screen is updated). is done when using the |CTRL-L| command (the whole screen is updated).
Example, to highlight the line where the cursor currently is: > Example, to highlight the line where the cursor currently is: >
@@ -942,16 +942,15 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on):
\%.c Matches at the cursor column. \%.c Matches at the cursor column.
\%<.c Matches before the cursor column. \%<.c Matches before the cursor column.
\%>.c Matches after the cursor column. \%>.c Matches after the cursor column.
These three can be used to match specific columns in a buffer or These six can be used to match specific columns in a buffer or string.
string. The "23" can be any column number. The first column is 1. The "23" can be any column number. The first column is 1. Actually,
Actually, the column is the byte number (thus it's not exactly right the column is the byte number (thus it's not exactly right for
for multibyte characters). multibyte characters).
WARNING: When inserting or deleting text Vim does not automatically WARNING: When inserting or deleting text Vim does not automatically
update the matches. This means Syntax highlighting quickly becomes update the matches. This means Syntax highlighting quickly becomes
wrong. Also when refering to the cursor position (".") and wrong. Also when referring to the cursor position (".") and
the cursor moves the display isn't updated for this change. An update the cursor moves the display isn't updated for this change. An update
is done when using the |CTRL-L| command (the whole screen is updated). is done when using the |CTRL-L| command (the whole screen is updated).
Example, to highlight the column where the cursor currently is: > Example, to highlight the column where the cursor currently is: >
:exe '/\%' .. col(".") .. 'c' :exe '/\%' .. col(".") .. 'c'
< Alternatively use: > < Alternatively use: >
@@ -969,8 +968,8 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on):
\%.v Matches at the current virtual column. \%.v Matches at the current virtual column.
\%<.v Matches before the current virtual column. \%<.v Matches before the current virtual column.
\%>.v Matches after the current virtual column. \%>.v Matches after the current virtual column.
These three can be used to match specific virtual columns in a buffer These six can be used to match specific virtual columns in a buffer or
or string. When not matching with a buffer in a window, the option string. When not matching with a buffer in a window, the option
values of the current window are used (e.g., 'tabstop'). values of the current window are used (e.g., 'tabstop').
The "23" can be any column number. The first column is 1. The "23" can be any column number. The first column is 1.
Note that some virtual column positions will never match, because they Note that some virtual column positions will never match, because they
@@ -978,7 +977,7 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on):
one screen character. one screen character.
WARNING: When inserting or deleting text Vim does not automatically WARNING: When inserting or deleting text Vim does not automatically
update highlighted matches. This means Syntax highlighting quickly update highlighted matches. This means Syntax highlighting quickly
becomes wrong. Also when refering to the cursor position (".") and becomes wrong. Also when referring to the cursor position (".") and
the cursor moves the display isn't updated for this change. An update the cursor moves the display isn't updated for this change. An update
is done when using the |CTRL-L| command (the whole screen is updated). is done when using the |CTRL-L| command (the whole screen is updated).
Example, to highlight all the characters after virtual column 72: > Example, to highlight all the characters after virtual column 72: >