mirror of
https://github.com/neovim/neovim.git
synced 2024-09-17 20:58:20 -04:00
Merge pull request #28529 from zeertzjq/vim-fe1e2b5e2d65
vim-patch: clarify syntax vs matching mechanism
This commit is contained in:
commit
694756252b
4
runtime/doc/builtin.txt
generated
4
runtime/doc/builtin.txt
generated
@ -8208,6 +8208,10 @@ synconcealed({lnum}, {col}) *synconcealed()*
|
||||
synconcealed(lnum, 5) [1, 'X', 2]
|
||||
synconcealed(lnum, 6) [0, '', 0]
|
||||
|
||||
Note: Doesn't consider |matchadd()| highlighting items,
|
||||
since syntax and matching highlighting are two different
|
||||
mechanisms |syntax-vs-match|.
|
||||
|
||||
synstack({lnum}, {col}) *synstack()*
|
||||
Return a |List|, which is the stack of syntax items at the
|
||||
position {lnum} and {col} in the current window. {lnum} is
|
||||
|
@ -1375,6 +1375,19 @@ Finally, these constructs are unique to Perl:
|
||||
==============================================================================
|
||||
10. Highlighting matches *match-highlight*
|
||||
|
||||
*syntax-vs-match*
|
||||
Note that the match highlight mechanism is independent
|
||||
of |syntax-highlighting|, which is (usually) a buffer-local
|
||||
highlighting, while matching is window-local, both methods
|
||||
can be freely mixed. Match highlighting functions give you
|
||||
a bit more flexibility in when and how to apply, but are
|
||||
typically only used for temporary highlighting, without strict
|
||||
rules. Both methods can be used to conceal text.
|
||||
|
||||
Thus the matching functions like |matchadd()| won't consider
|
||||
syntax rules and functions like |synconcealed()| and the
|
||||
other way around.
|
||||
|
||||
*:mat* *:match*
|
||||
:mat[ch] {group} /{pattern}/
|
||||
Define a pattern to highlight in the current window. It will
|
||||
|
@ -3825,7 +3825,9 @@ Whether or not it is actually concealed depends on the value of the
|
||||
'conceallevel' option. The 'concealcursor' option is used to decide whether
|
||||
concealable items in the current line are displayed unconcealed to be able to
|
||||
edit the line.
|
||||
Another way to conceal text is with |matchadd()|.
|
||||
|
||||
Another way to conceal text is with |matchadd()|, but internally this works a
|
||||
bit differently |syntax-vs-match|.
|
||||
|
||||
concealends *:syn-concealends*
|
||||
|
||||
@ -3833,7 +3835,9 @@ When the "concealends" argument is given, the start and end matches of
|
||||
the region, but not the contents of the region, are marked as concealable.
|
||||
Whether or not they are actually concealed depends on the setting on the
|
||||
'conceallevel' option. The ends of a region can only be concealed separately
|
||||
in this way when they have their own highlighting via "matchgroup"
|
||||
in this way when they have their own highlighting via "matchgroup". The
|
||||
|synconcealed()| function can be used to retrieve information about conealed
|
||||
items.
|
||||
|
||||
cchar *:syn-cchar*
|
||||
*E844*
|
||||
|
@ -948,7 +948,7 @@ Syntax and highlighting: *syntax-functions* *highlighting-functions*
|
||||
synIDattr() get a specific attribute of a syntax ID
|
||||
synIDtrans() get translated syntax ID
|
||||
synstack() get list of syntax IDs at a specific position
|
||||
synconcealed() get info about concealing
|
||||
synconcealed() get info about (syntax) concealing
|
||||
diff_hlID() get highlight ID for diff mode at a position
|
||||
matchadd() define a pattern to highlight (a "match")
|
||||
matchaddpos() define a list of positions to highlight
|
||||
|
4
runtime/lua/vim/_meta/vimfn.lua
generated
4
runtime/lua/vim/_meta/vimfn.lua
generated
@ -9752,6 +9752,10 @@ function vim.fn.synIDtrans(synID) end
|
||||
--- synconcealed(lnum, 5) [1, 'X', 2]
|
||||
--- synconcealed(lnum, 6) [0, '', 0]
|
||||
---
|
||||
--- Note: Doesn't consider |matchadd()| highlighting items,
|
||||
--- since syntax and matching highlighting are two different
|
||||
--- mechanisms |syntax-vs-match|.
|
||||
---
|
||||
--- @param lnum integer
|
||||
--- @param col integer
|
||||
--- @return {[1]: integer, [2]: string, [3]: integer}
|
||||
|
@ -11621,6 +11621,10 @@ M.funcs = {
|
||||
synconcealed(lnum, 4) [1, 'X', 2]
|
||||
synconcealed(lnum, 5) [1, 'X', 2]
|
||||
synconcealed(lnum, 6) [0, '', 0]
|
||||
|
||||
Note: Doesn't consider |matchadd()| highlighting items,
|
||||
since syntax and matching highlighting are two different
|
||||
mechanisms |syntax-vs-match|.
|
||||
]=],
|
||||
name = 'synconcealed',
|
||||
params = { { 'lnum', 'integer' }, { 'col', 'integer' } },
|
||||
|
Loading…
Reference in New Issue
Block a user