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

632Re: clear_next don't work correctly.

Expand Messages
  • Bram Moolenaar
    Apr 20, 2002
    • 0 Attachment
      Yasuhiro Matsumoto wrote:

      > >I don't see how this can go wrong, unless the mb_off2cells() call gives
      > >a wrong result. I guess that might happen when it's called with an
      > >offset that points to the right halve of a double-wide character. At
      > >least for DBCS characters this does not appear to be checked and an
      > >invalid result might be returned.
      > >
      > >I think we should attempt to fix the cause of the problem and not work
      > >around it. mb_off2cells() appears to be used in several places where we
      > >don't know if we are looking at a single-byte character, the head byte
      > >or the tail byte of a double-byte character. Can this be fixed?
      >
      > Hmm, I guess that the patch should be included.
      > if leadbyte erase by single-width character,
      > double-width character will be broken.
      > Then, the trailbyte and leadbyte of next character might become DBCS.
      >
      > For example, putting ' ' on '[][]'.
      >
      > [][] : clear_next_cell will be TRUE
      > v
      > ][] : set ptr = " ", but mbyte_cells become 2.
      > v
      > [] : thus, set ptr = " " again.
      > v
      > ] : repeat ....
      > v
      > : repeat ....

      That's not what I was asking. Where you say "mbyte_cells become 2", I
      don't understand it. mbyte_cells is 1 when displaying the extra " ".
      Do you mean mb_off2cells() returns 2? That is the problem I was talking
      about.

      --
      Emacs is a nice OS - but it lacks a good text editor.
      That's why I am using Vim. --Anonymous

      /// 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