matchparen: do not use hard-coded match id (#13393)

* matchparen: do not use hard-coded match id

Instead of using the hard-coded match id 3, which may also be used by
other plugins, let the matchparen plugin use whatever ids are
automatically returned when calling matchaddpos().

For backwards-compatibility, keep the `:3match` call, which will still
use the hard-coded id 3 (as mentioned in :h :3match).

closes: #13381

Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Christian Brabandt
2023-10-21 11:06:50 +02:00
committed by GitHub
parent 47416d1a74
commit d3e277f279
2 changed files with 18 additions and 10 deletions

View File

@ -1,4 +1,4 @@
*pattern.txt* For Vim version 9.0. Last change: 2023 Feb 04
*pattern.txt* For Vim version 9.0. Last change: 2023 Oct 20
VIM REFERENCE MANUAL by Bram Moolenaar
@ -1461,10 +1461,11 @@ Finally, these constructs are unique to Perl:
Just like |:match| above, but set a separate match. Thus
there can be three matches active at the same time. The match
with the lowest number has priority if several match at the
same position.
The ":3match" command is used by the |matchparen| plugin. You
are suggested to use ":match" for manual matching and
":2match" for another plugin.
same position. It uses the match id 3.
The ":3match" command is used by (older Vims) |matchparen|
plugin. You are suggested to use ":match" for manual matching
and ":2match" for another plugin or even better make use of
the more flexible |matchadd()| (and similar) functions instead.
==============================================================================
11. Fuzzy matching *fuzzy-matching*