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

Re: undo/redo mess with version 7.0 and utf-8 text

Expand Messages
  • Yukihiro Nakadaira
    # I failed in sending this mail. I ll resend it. This is old subject but I think this report might help someone. When using GTK2 GUI and XIM and
    Message 1 of 2 , Aug 28, 2006
    • 0 Attachment
      # I failed in sending this mail. I'll resend it.

      This is old subject but I think this report might help someone.

      When using GTK2 GUI and XIM and GTK_IM_MODULE=scim, one undo command undoes
      several insert command because undo sequence is not broken. And also it
      causes error E438. This is because ...
      1. scim doesn't invoke im_preedit_start_cb() and im_preedit_end_cb(), so the
      xim_has_preediting can be reset in im_preedit_changed_cb() only.
      2. To delete preedit, scim invoke im_preedit_changed_cb() with empty
      preedit string only one time. But at the time preedit_start_col is not
      MAXCOL and xim_is_preediting is not reset.
      Therefore xim_is_preediting is always TRUE and undo sequence is not broken
      (u_sync() is canceled).

      This problem can be avoided to use OverTheSpot instead of OnTheSpot (this
      can be set with scim-setup), or to set environment variables,
      GTK_IM_MODULE=xim and XMODIFIERS=@im=SCIM, or to use the following patch.
      The code around there was added at 6.2.451. I don't understand why checking
      if preedit_start_col is MAXCOL. I think that the line can be removed.


      *** mbyte.c.orig Mon Aug 28 17:19:28 2006
      --- mbyte.c Mon Aug 28 17:19:30 2006
      ***************
      *** 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. */
      --- 3741,3747 ----
      }
      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. */


      -- Yukihiro Nakadaira <hopper2@...>
    • Bram Moolenaar
      ... Most of the variables involved aren t properly explained, thus I can t oversee what happens here. I ll assume your fix is right and doesn t cause trouble
      Message 2 of 2 , Aug 28, 2006
      • 0 Attachment
        Yukihiro Nakadaira wrote:

        > This is old subject but I think this report might help someone.
        >
        > When using GTK2 GUI and XIM and GTK_IM_MODULE=scim, one undo command undoes
        > several insert command because undo sequence is not broken. And also it
        > causes error E438. This is because ...
        > 1. scim doesn't invoke im_preedit_start_cb() and im_preedit_end_cb(), so the
        > xim_has_preediting can be reset in im_preedit_changed_cb() only.
        > 2. To delete preedit, scim invoke im_preedit_changed_cb() with empty
        > preedit string only one time. But at the time preedit_start_col is not
        > MAXCOL and xim_is_preediting is not reset.
        > Therefore xim_is_preediting is always TRUE and undo sequence is not broken
        > (u_sync() is canceled).
        >
        > This problem can be avoided to use OverTheSpot instead of OnTheSpot (this
        > can be set with scim-setup), or to set environment variables,
        > GTK_IM_MODULE=xim and XMODIFIERS=@im=SCIM, or to use the following
        > patch. The code around there was added at 6.2.451. I don't
        > understand why checking if preedit_start_col is MAXCOL. I think that
        > the line can be removed.

        Most of the variables involved aren't properly explained, thus I can't
        oversee what happens here. I'll assume your fix is right and doesn't
        cause trouble for someone with another setup.

        --
        hundred-and-one symptoms of being an internet addict:
        254. You wake up daily with your keyboard printed on your forehead.

        /// Bram Moolenaar -- Bram@... -- 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 ///
      Your message has been successfully submitted and would be delivered to recipients shortly.