mirror of
https://github.com/neovim/neovim.git
synced 2025-09-30 23:18:33 +00:00
vim-patch:9.1.0217: regexp: verymagic cannot match before/after a mark (#28074)
Problem: regexp: verymagic cannot match before/after a mark
Solution: Correctly check for the very magic check (Julio B)
Fix regexp parser for \v%>'m and \v%<'m
Currently \v%'m works fine, but it is unable to match before or after
the position of mark m.
closes: vim/vim#14309
46fa3c7e27
Co-authored-by: Julio B <julio.bacel@gmail.com>
This commit is contained in:
@@ -4494,7 +4494,7 @@ static uint8_t *regatom(int *flagp)
|
||||
n = n * 10 + (uint32_t)(c - '0');
|
||||
c = getchr();
|
||||
}
|
||||
if (c == '\'' && n == 0) {
|
||||
if (no_Magic(c) == '\'' && n == 0) {
|
||||
// "\%'m", "\%<'m" and "\%>'m": Mark
|
||||
c = getchr();
|
||||
ret = regnode(RE_MARK);
|
||||
@@ -10218,7 +10218,7 @@ static int nfa_regatom(void)
|
||||
}
|
||||
EMIT((int)n);
|
||||
break;
|
||||
} else if (c == '\'' && n == 0) {
|
||||
} else if (no_Magic(c) == '\'' && n == 0) {
|
||||
// \%'m \%<'m \%>'m
|
||||
EMIT(cmp == '<' ? NFA_MARK_LT
|
||||
: cmp == '>' ? NFA_MARK_GT : NFA_MARK);
|
||||
|
Reference in New Issue
Block a user