mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 14:38:32 +00:00
vim-patch:7.4.292 #754
Problem: Searching for "a" does not match accented "a" with new regexp engine, does match with old engine. (David Bürgin) "ca" does not match "ca" with accented "a" with either engine. Solution: Change the old engine, check for following composing character also for single-byte patterns. https://code.google.com/p/vim/source/detail?r=60cdaa05a6ad31cef55eb6b3dc1f57ecac6fcf79
This commit is contained in:

committed by
Justin M. Keyes

parent
01ca4600ba
commit
37fe5aa444
@@ -4093,25 +4093,28 @@ regmatch (
|
|||||||
else if (*opnd == NUL) {
|
else if (*opnd == NUL) {
|
||||||
/* match empty string always works; happens when "~" is
|
/* match empty string always works; happens when "~" is
|
||||||
* empty. */
|
* empty. */
|
||||||
} else if (opnd[1] == NUL
|
} else {
|
||||||
&& !(enc_utf8 && ireg_ic)
|
if (opnd[1] == NUL && !(enc_utf8 && ireg_ic)) {
|
||||||
)
|
len = 1; /* matched a single byte above */
|
||||||
++reginput; /* matched a single char */
|
} else {
|
||||||
else {
|
// Need to match first byte again for multi-byte.
|
||||||
len = (int)STRLEN(opnd);
|
len = (int)STRLEN(opnd);
|
||||||
/* Need to match first byte again for multi-byte. */
|
if (cstrncmp(opnd, reginput, &len) != 0) {
|
||||||
if (cstrncmp(opnd, reginput, &len) != 0)
|
|
||||||
status = RA_NOMATCH;
|
|
||||||
/* Check for following composing character. */
|
|
||||||
else if (enc_utf8
|
|
||||||
&& UTF_COMPOSINGLIKE(reginput, reginput + len)) {
|
|
||||||
/* raaron: This code makes a composing character get
|
|
||||||
* ignored, which is the correct behavior (sometimes)
|
|
||||||
* for voweled Hebrew texts. */
|
|
||||||
if (!ireg_icombine)
|
|
||||||
status = RA_NOMATCH;
|
status = RA_NOMATCH;
|
||||||
} else
|
}
|
||||||
|
}
|
||||||
|
// Check for following composing character.
|
||||||
|
if (status != RA_NOMATCH && enc_utf8
|
||||||
|
&& UTF_COMPOSINGLIKE(reginput, reginput + len)
|
||||||
|
&& !ireg_icombine) {
|
||||||
|
// raaron: This code makes a composing character get
|
||||||
|
// ignored, which is the correct behavior (sometimes)
|
||||||
|
// for voweled Hebrew texts.
|
||||||
|
status = RA_NOMATCH;
|
||||||
|
}
|
||||||
|
if (status != RA_NOMATCH) {
|
||||||
reginput += len;
|
reginput += len;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@@ -49,6 +49,8 @@ STARTTEST
|
|||||||
:call add(tl, [2, ".\u05b9", " y\u05bb\u05b9 x\u05b9 ", "y\u05bb\u05b9"])
|
:call add(tl, [2, ".\u05b9", " y\u05bb\u05b9 x\u05b9 ", "y\u05bb\u05b9"])
|
||||||
:call add(tl, [1, "\u05b9\u05bb", " y\u05b9 x\u05b9\u05bb ", "x\u05b9\u05bb"])
|
:call add(tl, [1, "\u05b9\u05bb", " y\u05b9 x\u05b9\u05bb ", "x\u05b9\u05bb"])
|
||||||
:call add(tl, [2, ".\u05b9\u05bb", " y\u05bb x\u05b9\u05bb ", "x\u05b9\u05bb"])
|
:call add(tl, [2, ".\u05b9\u05bb", " y\u05bb x\u05b9\u05bb ", "x\u05b9\u05bb"])
|
||||||
|
:call add(tl, [2, "a", "ca\u0300t"])
|
||||||
|
:call add(tl, [2, "a\u0300", "ca\u0300t", "a\u0300"])
|
||||||
|
|
||||||
|
|
||||||
:"""" Test \Z
|
:"""" Test \Z
|
||||||
|
@@ -67,6 +67,12 @@ OK 2 - ֹֻ
|
|||||||
OK 0 - .ֹֻ
|
OK 0 - .ֹֻ
|
||||||
OK 1 - .ֹֻ
|
OK 1 - .ֹֻ
|
||||||
OK 2 - .ֹֻ
|
OK 2 - .ֹֻ
|
||||||
|
OK 0 - a
|
||||||
|
OK 1 - a
|
||||||
|
OK 2 - a
|
||||||
|
OK 0 - à
|
||||||
|
OK 1 - à
|
||||||
|
OK 2 - à
|
||||||
OK 0 - ú\Z
|
OK 0 - ú\Z
|
||||||
OK 1 - ú\Z
|
OK 1 - ú\Z
|
||||||
OK 2 - ú\Z
|
OK 2 - ú\Z
|
||||||
|
@@ -226,7 +226,7 @@ static int included_patches[] = {
|
|||||||
//295,
|
//295,
|
||||||
//294,
|
//294,
|
||||||
//293,
|
//293,
|
||||||
//292,
|
292,
|
||||||
//291,
|
//291,
|
||||||
//290,
|
//290,
|
||||||
289,
|
289,
|
||||||
|
Reference in New Issue
Block a user