642735d
To: vim-dev@vim.org
642735d
Subject: Patch 7.0.067
642735d
Fcc: outbox
642735d
From: Bram Moolenaar <Bram@moolenaar.net>
642735d
Mime-Version: 1.0
642735d
Content-Type: text/plain; charset=ISO-8859-1
642735d
Content-Transfer-Encoding: 8bit
642735d
------------
642735d
642735d
Patch 7.0.067
642735d
Problem:    Undo doesn't always work properly when using "scim" input method.
642735d
	    Undo is split up when using preediting.
642735d
Solution:   Reset xim_has_preediting also when preedit_start_col is not
642735d
	    MAXCOL.  Don't split undo when <Left> is used while preediting.
642735d
	    (Yukihiro Nakadaira)
642735d
Files:	    src/edit.c, src/mbyte.c
642735d
642735d
642735d
*** ../vim-7.0.066/src/edit.c	Tue Aug 22 19:58:22 2006
642735d
--- src/edit.c	Tue Aug 29 14:57:46 2006
642735d
***************
642735d
*** 8597,8603 ****
642735d
      tpos = curwin->w_cursor;
642735d
      if (oneleft() == OK)
642735d
      {
642735d
! 	start_arrow(&tpos);
642735d
  #ifdef FEAT_RIGHTLEFT
642735d
  	/* If exit reversed string, position is fixed */
642735d
  	if (revins_scol != -1 && (int)curwin->w_cursor.col >= revins_scol)
642735d
--- 8597,8608 ----
642735d
      tpos = curwin->w_cursor;
642735d
      if (oneleft() == OK)
642735d
      {
642735d
! #if defined(FEAT_XIM) && defined(FEAT_GUI_GTK)
642735d
! 	/* Only call start_arrow() when not busy with preediting, it will
642735d
! 	 * break undo.  K_LEFT is inserted in im_correct_cursor(). */
642735d
! 	if (!im_is_preediting())
642735d
! #endif
642735d
! 	    start_arrow(&tpos);
642735d
  #ifdef FEAT_RIGHTLEFT
642735d
  	/* If exit reversed string, position is fixed */
642735d
  	if (revins_scol != -1 && (int)curwin->w_cursor.col >= revins_scol)
642735d
*** ../vim-7.0.066/src/mbyte.c	Wed Aug 16 18:05:36 2006
642735d
--- src/mbyte.c	Tue Aug 29 14:41:45 2006
642735d
***************
642735d
*** 3514,3519 ****
642735d
--- 3514,3524 ----
642735d
  	add_to_input_buf(delkey, (int)sizeof(delkey));
642735d
  }
642735d
  
642735d
+ /*
642735d
+  * Move the cursor left by "num_move_back" characters.
642735d
+  * Note that ins_left() checks im_is_preediting() to avoid breaking undo for
642735d
+  * these K_LEFT keys.
642735d
+  */
642735d
      static void
642735d
  im_correct_cursor(int num_move_back)
642735d
  {
642735d
***************
642735d
*** 3741,3748 ****
642735d
      }
642735d
      else if (cursor_index == 0 && preedit_string[0] == '\0')
642735d
      {
642735d
! 	if (preedit_start_col == MAXCOL)
642735d
! 	    xim_has_preediting = FALSE;
642735d
  
642735d
  	/* If at the start position (after typing backspace)
642735d
  	 * preedit_start_col must be reset. */
642735d
--- 3746,3752 ----
642735d
      }
642735d
      else if (cursor_index == 0 && preedit_string[0] == '\0')
642735d
      {
642735d
! 	xim_has_preediting = FALSE;
642735d
  
642735d
  	/* If at the start position (after typing backspace)
642735d
  	 * preedit_start_col must be reset. */
642735d
*** ../vim-7.0.066/src/version.c	Tue Aug 22 21:51:18 2006
642735d
--- src/version.c	Tue Aug 29 16:09:35 2006
642735d
***************
642735d
*** 668,669 ****
642735d
--- 668,671 ----
642735d
  {   /* Add new patch number below this line */
642735d
+ /**/
642735d
+     67,
642735d
  /**/
642735d
642735d
-- 
642735d
hundred-and-one symptoms of being an internet addict:
642735d
265. Your reason for not staying in touch with family is that
642735d
     they do not have e-mail addresses.
642735d
642735d
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
642735d
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
642735d
\\\        download, build and distribute -- http://www.A-A-P.org        ///
642735d
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///