To: vim_dev@googlegroups.com
Subject: Patch 7.3.789
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------
Patch 7.3.789 (after 7.3.776)
Problem: "\k" in regexp does not work in other window.
Solution: Use the right buffer. (Yukihiro Nakadaira)
Files: src/mbyte.c, src/proto/mbyte.pro, src/regexp.c
*** ../vim-7.3.788/src/mbyte.c 2013-01-23 16:19:17.000000000 +0100
--- src/mbyte.c 2013-01-30 13:53:07.000000000 +0100
***************
*** 869,879 ****
mb_get_class(p)
char_u *p;
{
if (MB_BYTE2LEN(p[0]) == 1)
{
if (p[0] == NUL || vim_iswhite(p[0]))
return 0;
! if (vim_iswordc(p[0]))
return 2;
return 1;
}
--- 869,887 ----
mb_get_class(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 (p[0] == NUL || vim_iswhite(p[0]))
return 0;
! if (vim_iswordc_buf(p[0], buf))
return 2;
return 1;
}
*** ../vim-7.3.788/src/proto/mbyte.pro 2011-08-10 13:21:30.000000000 +0200
--- src/proto/mbyte.pro 2013-01-30 13:53:27.000000000 +0100
***************
*** 4,9 ****
--- 4,10 ----
int bomb_size __ARGS((void));
void remove_bom __ARGS((char_u *s));
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 latin_char2len __ARGS((int c));
int latin_char2bytes __ARGS((int c, char_u *buf));
*** ../vim-7.3.788/src/regexp.c 2013-01-25 20:10:58.000000000 +0100
--- src/regexp.c 2013-01-30 13:55:39.000000000 +0100
***************
*** 4013,4020 ****
reg_prev_class()
{
if (reginput > regline)
! return mb_get_class(reginput - 1
! - (*mb_head_off)(regline, reginput - 1));
return -1;
}
--- 4013,4020 ----
reg_prev_class()
{
if (reginput > regline)
! return mb_get_class_buf(reginput - 1
! - (*mb_head_off)(regline, reginput - 1), reg_buf);
return -1;
}
***************
*** 4304,4310 ****
int this_class;
/* Get class of current and previous char (if it exists). */
! this_class = mb_get_class(reginput);
if (this_class <= 1)
status = RA_NOMATCH; /* not on a word at all */
else if (reg_prev_class() == this_class)
--- 4304,4310 ----
int this_class;
/* Get class of current and previous char (if it exists). */
! this_class = mb_get_class_buf(reginput, reg_buf);
if (this_class <= 1)
status = RA_NOMATCH; /* not on a word at all */
else if (reg_prev_class() == this_class)
***************
*** 4328,4334 ****
int this_class, prev_class;
/* Get class of current and previous char (if it exists). */
! this_class = mb_get_class(reginput);
prev_class = reg_prev_class();
if (this_class == prev_class
|| prev_class == 0 || prev_class == 1)
--- 4328,4334 ----
int this_class, prev_class;
/* Get class of current and previous char (if it exists). */
! this_class = mb_get_class_buf(reginput, reg_buf);
prev_class = reg_prev_class();
if (this_class == prev_class
|| prev_class == 0 || prev_class == 1)
***************
*** 4365,4378 ****
break;
case KWORD:
! if (!vim_iswordp(reginput))
status = RA_NOMATCH;
else
ADVANCE_REGINPUT();
break;
case SKWORD:
! if (VIM_ISDIGIT(*reginput) || !vim_iswordp(reginput))
status = RA_NOMATCH;
else
ADVANCE_REGINPUT();
--- 4365,4378 ----
break;
case KWORD:
! if (!vim_iswordp_buf(reginput, reg_buf))
status = RA_NOMATCH;
else
ADVANCE_REGINPUT();
break;
case SKWORD:
! if (VIM_ISDIGIT(*reginput) || !vim_iswordp_buf(reginput, reg_buf))
status = RA_NOMATCH;
else
ADVANCE_REGINPUT();
***************
*** 5734,5740 ****
case SKWORD + ADD_NL:
while (count < maxcount)
{
! if (vim_iswordp(scan) && (testval || !VIM_ISDIGIT(*scan)))
{
mb_ptr_adv(scan);
}
--- 5734,5741 ----
case SKWORD + ADD_NL:
while (count < maxcount)
{
! if (vim_iswordp_buf(scan, reg_buf)
! && (testval || !VIM_ISDIGIT(*scan)))
{
mb_ptr_adv(scan);
}
*** ../vim-7.3.788/src/version.c 2013-01-30 12:50:50.000000000 +0100
--- src/version.c 2013-01-30 13:58:07.000000000 +0100
***************
*** 727,728 ****
--- 727,730 ----
{ /* Add new patch number below this line */
+ /**/
+ 789,
/**/
--
MARTHA'S WAY: Don't throw out all that leftover wine. Freeze into ice cubes
for future use in casseroles and sauces.
MY WAY: What leftover wine?
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///