diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-03-28 18:15:41 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-28 18:15:41 +0800 |
commit | 6364fc617ded29100c1aa3103e189fd983dd5e64 (patch) | |
tree | cb5a635a8f2298adfe1531933d9037001b61fc81 /src/nvim/regexp.c | |
parent | c804d7968bb54eaac240e879346e7ad55a03b77b (diff) | |
download | rneovim-6364fc617ded29100c1aa3103e189fd983dd5e64.tar.gz rneovim-6364fc617ded29100c1aa3103e189fd983dd5e64.tar.bz2 rneovim-6364fc617ded29100c1aa3103e189fd983dd5e64.zip |
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
https://github.com/vim/vim/commit/46fa3c7e271eb2abb05a0d9e6dbc9c36c2b2da02
Co-authored-by: Julio B <julio.bacel@gmail.com>
Diffstat (limited to 'src/nvim/regexp.c')
-rw-r--r-- | src/nvim/regexp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c index 86082adbb6..08c804bca5 100644 --- a/src/nvim/regexp.c +++ b/src/nvim/regexp.c @@ -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); |