mirror of
https://github.com/vim/vim.git
synced 2025-09-26 04:04:07 -04:00
updated for version 7.3.789
Problem: "\k" in regexp does not work in other window. Solution: Use the right buffer. (Yukihiro Nakadaira)
This commit is contained in:
10
src/mbyte.c
10
src/mbyte.c
@@ -868,12 +868,20 @@ remove_bom(s)
|
|||||||
int
|
int
|
||||||
mb_get_class(p)
|
mb_get_class(p)
|
||||||
char_u *p;
|
char_u *p;
|
||||||
|
{
|
||||||
|
return mb_get_class_buf(p, curbuf);
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
mb_get_class_buf(p, buf)
|
||||||
|
char_u *p;
|
||||||
|
buf_T *buf;
|
||||||
{
|
{
|
||||||
if (MB_BYTE2LEN(p[0]) == 1)
|
if (MB_BYTE2LEN(p[0]) == 1)
|
||||||
{
|
{
|
||||||
if (p[0] == NUL || vim_iswhite(p[0]))
|
if (p[0] == NUL || vim_iswhite(p[0]))
|
||||||
return 0;
|
return 0;
|
||||||
if (vim_iswordc(p[0]))
|
if (vim_iswordc_buf(p[0], buf))
|
||||||
return 2;
|
return 2;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@@ -4,6 +4,7 @@ char_u *mb_init __ARGS((void));
|
|||||||
int bomb_size __ARGS((void));
|
int bomb_size __ARGS((void));
|
||||||
void remove_bom __ARGS((char_u *s));
|
void remove_bom __ARGS((char_u *s));
|
||||||
int mb_get_class __ARGS((char_u *p));
|
int mb_get_class __ARGS((char_u *p));
|
||||||
|
int mb_get_class_buf __ARGS((char_u *p, buf_T *buf));
|
||||||
int dbcs_class __ARGS((unsigned lead, unsigned trail));
|
int dbcs_class __ARGS((unsigned lead, unsigned trail));
|
||||||
int latin_char2len __ARGS((int c));
|
int latin_char2len __ARGS((int c));
|
||||||
int latin_char2bytes __ARGS((int c, char_u *buf));
|
int latin_char2bytes __ARGS((int c, char_u *buf));
|
||||||
|
15
src/regexp.c
15
src/regexp.c
@@ -4013,8 +4013,8 @@ static int reg_prev_class __ARGS((void));
|
|||||||
reg_prev_class()
|
reg_prev_class()
|
||||||
{
|
{
|
||||||
if (reginput > regline)
|
if (reginput > regline)
|
||||||
return mb_get_class(reginput - 1
|
return mb_get_class_buf(reginput - 1
|
||||||
- (*mb_head_off)(regline, reginput - 1));
|
- (*mb_head_off)(regline, reginput - 1), reg_buf);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4304,7 +4304,7 @@ regmatch(scan)
|
|||||||
int this_class;
|
int this_class;
|
||||||
|
|
||||||
/* Get class of current and previous char (if it exists). */
|
/* Get class of current and previous char (if it exists). */
|
||||||
this_class = mb_get_class(reginput);
|
this_class = mb_get_class_buf(reginput, reg_buf);
|
||||||
if (this_class <= 1)
|
if (this_class <= 1)
|
||||||
status = RA_NOMATCH; /* not on a word at all */
|
status = RA_NOMATCH; /* not on a word at all */
|
||||||
else if (reg_prev_class() == this_class)
|
else if (reg_prev_class() == this_class)
|
||||||
@@ -4328,7 +4328,7 @@ regmatch(scan)
|
|||||||
int this_class, prev_class;
|
int this_class, prev_class;
|
||||||
|
|
||||||
/* Get class of current and previous char (if it exists). */
|
/* Get class of current and previous char (if it exists). */
|
||||||
this_class = mb_get_class(reginput);
|
this_class = mb_get_class_buf(reginput, reg_buf);
|
||||||
prev_class = reg_prev_class();
|
prev_class = reg_prev_class();
|
||||||
if (this_class == prev_class
|
if (this_class == prev_class
|
||||||
|| prev_class == 0 || prev_class == 1)
|
|| prev_class == 0 || prev_class == 1)
|
||||||
@@ -4365,14 +4365,14 @@ regmatch(scan)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case KWORD:
|
case KWORD:
|
||||||
if (!vim_iswordp(reginput))
|
if (!vim_iswordp_buf(reginput, reg_buf))
|
||||||
status = RA_NOMATCH;
|
status = RA_NOMATCH;
|
||||||
else
|
else
|
||||||
ADVANCE_REGINPUT();
|
ADVANCE_REGINPUT();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SKWORD:
|
case SKWORD:
|
||||||
if (VIM_ISDIGIT(*reginput) || !vim_iswordp(reginput))
|
if (VIM_ISDIGIT(*reginput) || !vim_iswordp_buf(reginput, reg_buf))
|
||||||
status = RA_NOMATCH;
|
status = RA_NOMATCH;
|
||||||
else
|
else
|
||||||
ADVANCE_REGINPUT();
|
ADVANCE_REGINPUT();
|
||||||
@@ -5734,7 +5734,8 @@ regrepeat(p, maxcount)
|
|||||||
case SKWORD + ADD_NL:
|
case SKWORD + ADD_NL:
|
||||||
while (count < maxcount)
|
while (count < maxcount)
|
||||||
{
|
{
|
||||||
if (vim_iswordp(scan) && (testval || !VIM_ISDIGIT(*scan)))
|
if (vim_iswordp_buf(scan, reg_buf)
|
||||||
|
&& (testval || !VIM_ISDIGIT(*scan)))
|
||||||
{
|
{
|
||||||
mb_ptr_adv(scan);
|
mb_ptr_adv(scan);
|
||||||
}
|
}
|
||||||
|
@@ -725,6 +725,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
789,
|
||||||
/**/
|
/**/
|
||||||
788,
|
788,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user