comparison src/regexp_nfa.c @ 34857:3f8444c5a6f3 v9.1.0297

patch 9.1.0297: Patch 9.1.0296 causes too many issues Commit: https://github.com/vim/vim/commit/c97f4d61cde24030f2f7d2318e1b409a0ccc3e43 Author: Christian Brabandt <cb@256bit.org> Date: Wed Apr 10 16:18:15 2024 +0200 patch 9.1.0297: Patch 9.1.0296 causes too many issues Problem: Patch 9.1.0296 causes too many issues (Tony Mechelynck, @chdiza, CI) Solution: Back out the change for now Revert "patch 9.1.0296: regexp: engines do not handle case-folding well" This reverts commit 7a27c108e0509f3255ebdcb6558e896c223e4d23 it causes issues with syntax highlighting and breaks the FreeBSD and MacOS CI. It needs more work. fixes: #14487 Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Wed, 10 Apr 2024 16:30:06 +0200
parents 97b5457962ed
children 0b259135fb3a
comparison
equal deleted inserted replaced
34856:73e0743621c3 34857:3f8444c5a6f3
5664 int match; 5664 int match;
5665 5665
5666 for (;;) 5666 for (;;)
5667 { 5667 {
5668 match = TRUE; 5668 match = TRUE;
5669 // skip regstart 5669 len2 = MB_CHAR2LEN(regstart); // skip regstart
5670 len2 = MB_CHAR2LEN(regstart);
5671 if (enc_utf8 && len2 > 1 && MB_CHAR2LEN(PTR2CHAR(rex.line + col)) != len2)
5672 // because of case-folding of the previously matched text, we may need
5673 // to skip fewer bytes than mb_char2len(regstart)
5674 len2 = mb_char2len(utf_fold(regstart));
5675 for (len1 = 0; match_text[len1] != NUL; len1 += MB_CHAR2LEN(c1)) 5670 for (len1 = 0; match_text[len1] != NUL; len1 += MB_CHAR2LEN(c1))
5676 { 5671 {
5677 c1 = PTR2CHAR(match_text + len1); 5672 c1 = PTR2CHAR(match_text + len1);
5678 c2 = PTR2CHAR(rex.line + col + len2); 5673 c2 = PTR2CHAR(rex.line + col + len2);
5679 if (c1 != c2 && (!rex.reg_ic || MB_CASEFOLD(c1) != MB_CASEFOLD(c2))) 5674 if (c1 != c2 && (!rex.reg_ic || MB_CASEFOLD(c1) != MB_CASEFOLD(c2)))
7506 if (skip_to_start(prog->regstart, &col) == FAIL) 7501 if (skip_to_start(prog->regstart, &col) == FAIL)
7507 return 0L; 7502 return 0L;
7508 7503
7509 // If match_text is set it contains the full text that must match. 7504 // If match_text is set it contains the full text that must match.
7510 // Nothing else to try. Doesn't handle combining chars well. 7505 // Nothing else to try. Doesn't handle combining chars well.
7511 if (prog->match_text != NULL && *prog->match_text != NUL && !rex.reg_icombine) 7506 if (prog->match_text != NULL && !rex.reg_icombine)
7512 { 7507 {
7513 retval = find_match_text(&col, prog->regstart, prog->match_text); 7508 retval = find_match_text(&col, prog->regstart, prog->match_text);
7514 if (REG_MULTI) 7509 if (REG_MULTI)
7515 rex.reg_mmatch->rmm_matchcol = col; 7510 rex.reg_mmatch->rmm_matchcol = col;
7516 else 7511 else