To: [email protected]
Subject: Patch 5.7a.002
Fcc: outbox
From: Bram Moolenaar <[email protected]>
------------

Patch 5.7a.002
Problem:    Multi-byte: 'showmatch' is performed when second byte of an
           inserted double-byte char is a paren or brace.
Solution:   Check IsTrailByte() before calling showmatch(). (Taro Muraoka)
Files:      src/misc1.c


*** ../vim-5.7a.1/src/misc1.c   Mon Jun  5 20:45:41 2000
--- src/misc1.c Wed Jun 14 21:51:17 2000
***************
*** 1456,1473 ****
     ml_replace(lnum, newp, FALSE);

     /*
!      * If we're in insert or replace mode and 'showmatch' is set, then check for
!      * right parens and braces. If there isn't a match, then beep. If there
!      * is a match AND it's on the screen, then flash to it briefly. If it
!      * isn't on the screen, don't do anything.
      */
 #ifdef RIGHTLEFT
!     if (p_sm && (State & INSERT) &&
!       ((!(curwin->w_p_rl ^ p_ri) && (c == ')' || c == '}' || c == ']')) ||
!        ((curwin->w_p_rl ^ p_ri) && (c == '(' || c == '{' || c == '['))))
 #else
!     if (p_sm && (State & INSERT) && (c == ')' || c == '}' || c == ']'))
 #endif
       showmatch();

 #ifdef RIGHTLEFT
--- 1456,1477 ----
     ml_replace(lnum, newp, FALSE);

     /*
!      * If we're in Insert or Replace mode and 'showmatch' is set, then briefly
!      * show the match for right parens and braces.
      */
+     if (p_sm && (State & INSERT)
 #ifdef RIGHTLEFT
!           && ((!(curwin->w_p_rl ^ p_ri)
!                   && (c == ')' || c == '}' || c == ']'))
!               || ((curwin->w_p_rl ^ p_ri)
!                   && (c == '(' || c == '{' || c == '[')))
 #else
!           && (c == ')' || c == '}' || c == ']')
 #endif
+ #ifdef MULTI_BYTE
+           && !(is_dbcs && IsTrailByte(newp, p))
+ #endif
+        )
       showmatch();

 #ifdef RIGHTLEFT
*** ../vim-5.7a.1/src/version.c Sun Jun 18 15:30:49 2000
--- src/version.c       Sun Jun 18 15:31:39 2000
***************
*** 420,421 ****
--- 420,423 ----
 {   /* Add new patch number below this line */
+ /**/
+     2,
 /**/

--
hundred-and-one symptoms of being an internet addict:
49. You never have to deal with busy signals when calling your ISP...because
   you never log off.

/-/-- Bram Moolenaar --- [email protected] --- http://www.moolenaar.net --\-\
\-\-- Vim: http://www.vim.org ---- ICCF Holland: http://www.vim.org/iccf --/-/