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

Re: Cannot input multibyte character that has CSI

Expand Messages
  • Taro Muraoka
    ... I checked why Bram s patch did not work. The reason is variable ch has CSI as unsined int 0xFFFFFF9B. It need cast to unsigned char (char_u) on compare.
    Message 1 of 8 , Apr 16, 2000
      I wrote:

      > I typed a multibyte character with leadbyte CSI, and It takes one or
      > more second that printed to screen. Before it printed, I typed more
      > keystroke, it makes characters broken.

      I checked why Bram's patch did not work. The reason is variable ch has
      CSI as unsined int 0xFFFFFF9B. It need cast to unsigned char (char_u)
      on compare. Below is one answer for Windows.

      I checked it works fine on Windows. But I did not check other plathome.
      Thanks.
      ----
      Taro Muraoka koron@...


      *** ../vim-5.6.67/src/gui_w32.c Wed Apr 5 16:30:51 2000
      --- src/gui_w32.c Sun Apr 16 11:58:42 2000
      ***************
      *** 816,832 ****
      UINT ch,
      int cRepeat)
      {
      ! char_u string[1];

      /* TRACE("OnChar(%d, %c)\n", ch, ch); */

      string[0] = ch;
      ! if (string[0] == Ctrl('C') && !mapped_ctrl_c)
      {
      trash_input_buf();
      got_int = TRUE;
      }
      ! add_to_input_buf(string, 1);
      }

      static void
      --- 816,841 ----
      UINT ch,
      int cRepeat)
      {
      ! char_u string[3];

      /* TRACE("OnChar(%d, %c)\n", ch, ch); */

      string[0] = ch;
      ! if (ch == Ctrl('C') && !mapped_ctrl_c)
      {
      trash_input_buf();
      got_int = TRUE;
      }
      !
      ! if ((char_u)ch == CSI) /* cast is needed */
      ! {
      ! /* Insert CSI as K_CSI. */
      ! string[1] = KS_EXTRA;
      ! string[2] = KE_CSI;
      ! add_to_input_buf(string, 3);
      ! }
      ! else
      ! add_to_input_buf(string, 1);
      }

      static void
      ***************
      *** 871,884 ****
      --- 880,901 ----
      string[len++] = KS_MODIFIER;
      string[len++] = modifiers;
      }
      +
      if (IS_SPECIAL(ch))
      {
      string[len++] = CSI;
      string[len++] = K_SECOND(ch);
      string[len++] = K_THIRD(ch);
      }
      + else if ((char_u)ch == CSI)
      + {
      + string[len++] = CSI;
      + string[len++] = KS_EXTRA;
      + string[len++] = KE_CSI;
      + }
      else
      string[len++] = ch;
      +
      add_to_input_buf(string, len);
      }
    • Bram Moolenaar
      ... And you made a fix for this in the next message. I ll include that. Thanks for testing! ... Sorry, I had to edit the patch for gui_mac.c, because I
      Message 2 of 8 , Apr 16, 2000
        Taro Muraoka wrote:

        > > Please try this out and let me know if this works or not.
        > >
        > > You may want to skip the parts of the patch for files that you don't have
        > > (gui_amiga.c, gui_mac.c, etc).
        >
        > I test the patch on Windows. I can input multibyte has CSI trailbyte.
        > But I cannot input multibyte has CSI leadbyte.
        >
        > I typed a multibyte character with leadbyte CSI, and It takes one or
        > more second that printed to screen. Before it printed, I typed more
        > keystroke, it makes characters broken.

        And you made a fix for this in the next message. I'll include that. Thanks
        for testing!

        > And, your patch for gui_mac.c was rejected. It seems for
        > gui_riscos.c doesn't it?

        Sorry, I had to edit the patch for gui_mac.c, because I already have many more
        changes for that file. Just ignore that part of the patch. I'll send out the
        Mac changes later.

        --
        hundred-and-one symptoms of being an internet addict:
        57. You begin to wonder how on earth your service provider is allowed to call
        200 hours per month "unlimited."

        /-/-- Bram Moolenaar --- Bram@... --- http://www.moolenaar.net --\-\
        \-\-- Vim: http://www.vim.org ---- ICCF Holland: http://www.vim.org/iccf --/-/
      Your message has been successfully submitted and would be delivered to recipients shortly.