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

patch for XIM, fixes lost characters

Expand Messages
  • Bram Moolenaar
    A few people have reported that after starting Insert mode, the first typed character is lost. So far only people on SGI machines reported this, thus I guess
    Message 1 of 1 , Aug 22, 2001
    • 0 Attachment
      A few people have reported that after starting Insert mode, the first typed
      character is lost. So far only people on SGI machines reported this, thus I
      guess it's a problem with the XIM implementation on those machines.

      The patch below should fix that. But perhaps for a few people this actually
      breaks something. Please try it out.

      This also fixes a problem that must have existed for a long time: The
      inputMethod resource was never used, because of using "== NUL" instead of "!=
      NUL".

      *** ../../vim-6.0as/src/mbyte.c Sun Aug 19 22:53:28 2001
      --- mbyte.c Wed Aug 22 11:37:25 2001
      ***************
      *** 3248,3254 ****
      if (xic != NULL)
      return FALSE;

      ! if (gui.input_method != NULL && *gui.input_method == NUL)
      {
      strcpy(tmp, gui.input_method);
      for (ns = s = tmp; ns != NULL && *s != NUL;)
      --- 3255,3261 ----
      if (xic != NULL)
      return FALSE;

      ! if (gui.input_method != NULL && *gui.input_method != NUL)
      {
      strcpy(tmp, gui.input_method);
      for (ns = s = tmp; ns != NULL && *s != NUL;)
      ***************
      *** 3277,3290 ****
      if (xim == NULL && (p = XSetLocaleModifiers("")) != NULL && *p != NUL)
      xim = XOpenIM(x11_display, NULL, NULL, NULL);

      - /* This is supposed to be useful to obtain characters through
      - * XmbLookupString() without really using a XIM. */
      - if (xim == NULL && (p = XSetLocaleModifiers("@im=none")) != NULL
      - && *p != NUL)
      - xim = XOpenIM(x11_display, NULL, NULL, NULL);
      -
      if (xim == NULL)
      xim = XOpenIM(x11_display, NULL, NULL, NULL);

      if (xim == NULL)
      {
      --- 3284,3300 ----
      if (xim == NULL && (p = XSetLocaleModifiers("")) != NULL && *p != NUL)
      xim = XOpenIM(x11_display, NULL, NULL, NULL);

      if (xim == NULL)
      + {
      + #ifndef __sgi
      + /* This is supposed to be useful to obtain characters through
      + * XmbLookupString() without really using a XIM. For SGI/Irix machines
      + * this apparently causes the first character after an "i" command to
      + * be lost. */
      + (void)XSetLocaleModifiers("@im=none");
      + #endif
      xim = XOpenIM(x11_display, NULL, NULL, NULL);
      + }

      if (xim == NULL)
      {

      --
      hundred-and-one symptoms of being an internet addict:
      90. Instead of calling you to dinner, your spouse sends e-mail.

      /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
      ((( Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim )))
      \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
    Your message has been successfully submitted and would be delivered to recipients shortly.