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

266Re: vim56-p87 problem

Expand Messages
  • Taro Muraoka
    Jun 6, 2000
      Hello, Sung-Hyun Nam, Bram Moolenaar, and vim-multibyte.

      > I have no problem if I do ':!cat file' (Don't know the routine
      > called by this command).
      > But multibyte corrupted if I do ':echo info'.
      > (I did, let info='multibyte string').

      There is lack of codes in patch-5.6.87. In patch I last sended to
      vim-multibyte, it included patch to eval.c(do_echo).

      Function do_echo() outputs bytes of message one by one, using function
      msg_outtrans_len_attr(). Function msg_outtrans_len_attr() force outputs
      a character at a time. When a lead byte of multibyte-character was
      passed to msg_outtrans_len_attr(), it and additionally trail byte are
      outputed. Then do_echo() try to output a trail byte of multibyte. It
      cause confusion.

      Patch I last sended, make do_echo() skip trail byte. Please try it.
      ----
      Taro Muraoka <koron@...>


      diff -cr src.orig/eval.c src/eval.c
      *** src.orig/eval.c Sat Apr 01 00:21:22 2000
      --- src/eval.c Mon May 29 16:36:18 2000
      ***************
      *** 4652,4657 ****
      --- 4652,4658 ----
      else if (echo)
      msg_puts_attr((char_u *)" ", echo_attr);
      for (p = get_var_string(&retvar); *p != NUL && !got_int; ++p)
      + {
      if (*p == '\n' || *p == '\r' || *p == TAB)
      {
      if (*p != TAB && needclr)
      ***************
      *** 4663,4669 ****
      --- 4664,4677 ----
      msg_putchar_attr(*p, echo_attr);
      }
      else
      + {
      (void)msg_outtrans_len_attr(p, 1, echo_attr);
      + #ifdef MULTI_BYTE
      + if (is_dbcs && *(p + 1) && IsLeadByte(*p))
      + ++p;
      + #endif
      + }
      + }
      }
      clear_var(&retvar);
      arg = skipwhite(arg);
    • Show all 4 messages in this topic