Prepare the following file as test.vimrc
:
set nocompatible packadd! matchit autocmd BufReadPost * let b:match_words = '^A\{5\,}:^B\{5\,}'
And prepare the following file as test.txt
:
AAAAAA
BBBBBB
Then open Vim
vim -u test.vimrc test.txt
Finally type %
on the first A
in the first line.
This causes the following errors:
Error detected while processing function matchit#Match_wrapper[85]..<SNR>15_Wholematch:
line 5:
E554: Syntax error in \{...}
E870: (NFA regexp) Error reading repetition limits
Error detected while processing function matchit#Match_wrapper:
line 86:
E554: Syntax error in \{...}
E870: (NFA regexp) Error reading repetition limits
Press ENTER or type command to continue
Since '^A\{5\,}:^B\{5\,}'
is set to b:match_words
, matchit.vim should jump between AAAAAA
and BBBBBB
without any error.
In this example output, comma is escaped as \,
not to conflict with delimiter of patterns. This is explained in doc/matchit.vim
as follows:
The format for |b:match_words| is similar to that of the 'matchpairs' option:
it is a comma (,)-separated list of groups; each group is a colon(:)-separated
list of patterns (regular expressions). Commas and colons that are part of a
pattern should be escaped with backslashes (':' and ',').
Master branch (5f1b115)
$TERM
: screen-256colorI investigated this issue by doing some print debugging and found that the escaped `\,` characters are not un-escaped actually. The backslash remained in the patterns so the regex engine complained that `A\{7\,}` was an invalid expression.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
Closed #14814 as completed via chrisbra/matchit@d167669.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.