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

MB at EOL and i_CTRL-O

Expand Messages
  • Taro Muraoka
    I made this patch. Please test this. ... Taro Muraoka ... Problem: At end-of-line that ends with a multibyte character, use i_CTRL-O
    Message 1 of 2 , Jun 17, 2000
    • 0 Attachment
      I made this patch. Please test this.
      ----
      Taro Muraoka <koron@...>


      ----
      Problem: At end-of-line that ends with a multibyte character, use
      i_CTRL-O and return to insert mode, then cursor moves 1
      character to the left.
      Solution: When returning from i_CTRL-O, check the end of line with a
      multibyte character.
      Files: src/edit.c


      *** vim-5.7a/src/edit.c.orig Sat Jun 17 00:05:58 2000
      --- vim-5.7a/src/edit.c Sat Jun 17 00:06:06 2000
      ***************
      *** 351,359 ****
      update_curswant();
      if ( ((o_eol && curwin->w_cursor.lnum == o_lnum)
      || curwin->w_curswant > curwin->w_virtcol)
      ! && *(ptr = ml_get_curline() + curwin->w_cursor.col) != NUL
      ! && *(ptr + 1) == NUL)
      ! ++curwin->w_cursor.col;
      }
      else
      {
      --- 351,364 ----
      update_curswant();
      if ( ((o_eol && curwin->w_cursor.lnum == o_lnum)
      || curwin->w_curswant > curwin->w_virtcol)
      ! && *(ptr = ml_get_curline() + curwin->w_cursor.col) != NUL)
      ! if (ptr[1] == NUL)
      ! ++curwin->w_cursor.col;
      ! #ifdef MULTI_BYTE
      ! else if (is_dbcs && ptr[2] == NUL && IsLeadByte(ptr[0])
      ! && IsTrailByte(ptr - curwin->w_cursor.col, ptr + 1))
      ! curwin->w_cursor.col += 2;
      ! #endif
      }
      else
      {
    • Bram Moolenaar
      ... Looks good, I ll include it. With an extra {} for the nested if/else, some compilers may give a warning for that. Thanks! -- hundred-and-one symptoms of
      Message 2 of 2 , Jun 17, 2000
      • 0 Attachment
        Taro Muraoka wrote:

        > I made this patch. Please test this.

        > ----
        > Problem: At end-of-line that ends with a multibyte character, use
        > i_CTRL-O and return to insert mode, then cursor moves 1
        > character to the left.
        > Solution: When returning from i_CTRL-O, check the end of line with a
        > multibyte character.
        > Files: src/edit.c

        Looks good, I'll include it. With an extra {} for the nested if/else, some
        compilers may give a warning for that.

        Thanks!

        --
        hundred-and-one symptoms of being an internet addict:
        45. You buy a Captain Kirk chair with a built-in keyboard and mouse.

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