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

637Re: clear_next don't work correctly.

Expand Messages
  • Bram Moolenaar
    Apr 23, 2002
      Yasuhiro Matsumoto wrote:

      > >Well, I can predict that if we fix it this way, the problem with
      > >mb_off2cell() will pop up later anyway. Since the utf-8 version of this
      > >function returns 1 when used on the right halve of a double-wide
      > >character, I think the dbcs version should do the same.
      > >
      > >I know this is a bit of work to get right, but I think it's worth it.
      > Hmm..., this is problem of this logic.
      > mb_off2cells should work correctly if the string is not broken.
      > but clear_next_cell might break the combination for leadbyte and trailbyte
      > until the part write a space.

      Yeah, that makes it complicated. The utf-8 character is stored
      separately, which means this is still available even when the left halve
      of the wide character was overwritten. For dbcs the lead byte has been
      overwritten, thus we no longer have the info about the second byte
      actually being a tail byte in the past.

      > Thus, mb_off2cells don't return right value.
      > It should not use same logic for filling a space.
      > And it should overwrite a space by force before breaking leadbyte.
      > I made a patch for this problem.
      > and I tested few case as following.
      > cp932 & cpoptions+=$ : cw
      > euc-jp & cpoptions+=$ : cw
      > utf-8 & cpoptions+=$ : cw
      > It seems good to me.

      Didn't we have it like this in the past? I'll have to check if there is
      no situation where this solution causes a problem. There was a reason
      we use clear_next_cell and don't write the space right there. Your
      patch looks good though.

      GALAHAD hurries to the door and pushes through it. As he leaves the room
      we CUT TO the reverse to show that he is now in a room full of bathing
      and romping GIRLIES, all innocent, wide-eyed and beautiful. They smile
      enchantingly at him as he tries to keep walking without being diverted by
      the lovely sights assaulting his eyeballs.
      "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

      /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
      /// Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim \\\
      \\\ Project leader for A-A-P -- http://www.a-a-p.org ///
      \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
    • Show all 10 messages in this topic