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