Loading ...
Sorry, an error occurred while loading the content.

showmatch and multibyte

Expand Messages
  • Taro Muraoka
    There is a little problem when input multibyte character with showmatch option. I want to suggest this patch. ... Taro Muraoka Problem:
    Message 1 of 3 , Jun 14, 2000
    • 0 Attachment
      There is a little problem when input multibyte character with showmatch
      option. I want to suggest this patch.
      ----
      Taro Muraoka <koron@...>


      Problem: With showmatch option, when insert a multibyte character
      that trailbyte is 0x29(')') or 0x5D(']') or 0x7D('}'),
      that cause a redundant showmatch.
      Solution: Check IsTrailByte before showmatch().
      Files: src/misc1.c

      *** vim-5.7a/src/misc1.c Tue Jun 06 03:45:42 2000
      --- vim-5.7a/src.j/misc1.c Wed Jun 14 09:56:44 2000
      ***************
      *** 1461,1473 ****
      * 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
      --- 1461,1478 ----
      * 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.
      */
      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
      ! /* Don't showmatch() when c is trailbyte */
      ! && (is_dbcs && !IsTrailByte(newp, p))
      #endif
      + )
      showmatch();

      #ifdef RIGHTLEFT
    • Bram Moolenaar
      ... Shouldn t that be: && !(is_dbcs && IsTrailByte(newp, p)) Otherwise showmatch() will never be called when is_dbcs isn t set. -- hundred-and-one symptoms of
      Message 2 of 3 , Jun 14, 2000
      • 0 Attachment
        Taro Muraoka wrote:

        > There is a little problem when input multibyte character with showmatch
        > option. I want to suggest this patch.

        It looks OK, except for one line:

        > ! #ifdef MULTI_BYTE
        > ! /* Don't showmatch() when c is trailbyte */
        > ! && (is_dbcs && !IsTrailByte(newp, p))
        > #endif

        Shouldn't that be:

        && !(is_dbcs && IsTrailByte(newp, p))

        Otherwise showmatch() will never be called when is_dbcs isn't set.

        --
        hundred-and-one symptoms of being an internet addict:
        18. Your wife drapes a blond wig over your monitor to remind you of what she
        looks like.

        /-/-- Bram Moolenaar --- Bram@... --- http://www.moolenaar.net --\-\
        \-\-- Vim: http://www.vim.org ---- ICCF Holland: http://www.vim.org/iccf --/-/
      • Taro Muraoka
        ... Yes. It is my mistake. Here new patch available. ... Taro Muraoka Problem: With showmatch option, when insert a multibyte
        Message 3 of 3 , Jun 17, 2000
        • 0 Attachment
          > Shouldn't that be:
          >
          > && !(is_dbcs && IsTrailByte(newp, p))
          >
          > Otherwise showmatch() will never be called when is_dbcs isn't set.

          Yes. It is my mistake. Here new patch available.
          ----
          Taro Muraoka <koron@...>


          Problem: With showmatch option, when insert a multibyte character
          that trailbyte is 0x29(')') or 0x5D(']') or 0x7D('}'),
          that cause a redundant showmatch.
          Solution: Check IsTrailByte before showmatch().
          Files: src/misc1.c

          *** vim-5.7a/src/misc1.c Tue Jun 06 03:45:42 2000
          --- vim-5.7a/src.j/misc1.c Wed Jun 14 09:56:44 2000
          ***************
          *** 1461,1473 ****
          * 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
          --- 1461,1478 ----
          * 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.
          */
          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
          ! /* Don't showmatch() when c is trailbyte */
          ! && !(is_dbcs && IsTrailByte(newp, p))
          #endif
          + )
          showmatch();

          #ifdef RIGHTLEFT
        Your message has been successfully submitted and would be delivered to recipients shortly.