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

vim60ad XIM cursor color patch

Expand Messages
  • Nam SungHyun
    Hello, This patch is for OnTheSpot method (only supported by GTK+ GUI). I stole the code from gui_w32.c. If you want to change the cursor color while
    Message 1 of 2 , May 2, 2001
    • 0 Attachment
      Hello,

      This patch is for OnTheSpot method (only supported by GTK+ GUI).

      I stole the code from gui_w32.c.
      If you want to change the cursor color while preediting,
      set 'CursorIM' highlight group. For example,
      :hi CursorIM guibg=DarkGreen guifg=NONE

      Regards,
      namsh

      diff -u -p -r1.17 gui.c
      --- ./gui.c 30 Apr 2001 07:28:15 -0000 1.17
      +++ ./gui.c 2 May 2001 04:58:42 -0000
      @@ -798,14 +798,14 @@ gui_update_cursor(force, clear_selection
      shape_table[idx].blinkoff);
      if (id > 0)
      {
      -#if defined(FEAT_GUI_W32) && defined(FEAT_MBYTE_IME)
      +#if (defined(FEAT_GUI_W32) && defined(FEAT_MBYTE_IME)) || defined(FEAT_XIM)
      guicolor_T ImeGetCursorColor(guicolor_T color);
      #endif

      cattr = syn_id2colors(id, &cfg, &cbg);
      --cbg;
      --cfg;
      -#if defined(FEAT_GUI_W32) && defined(FEAT_MBYTE_IME)
      +#if (defined(FEAT_GUI_W32) && defined(FEAT_MBYTE_IME)) || defined(FEAT_XIM)
      cbg = ImeGetCursorColor(cbg);
      #endif
      }
      diff -u -p -r1.6 mbyte.c
      --- ./mbyte.c 30 Apr 2001 07:28:16 -0000 1.6
      +++ ./mbyte.c 2 May 2001 04:59:21 -0000
      @@ -3239,6 +3239,29 @@ xim_get_status_area_height(void)
      return 0;
      }

      +/*
      + * When preedit is 'open' change cursor color to hilight 'CursorIM'
      + */
      + guicolor_T
      +ImeGetCursorColor(guicolor_T color)
      +{
      + static int id = 0;
      + guicolor_T fg, bg;
      +
      + if (xim_preediting)
      + {
      + if (!id)
      + id = syn_name2id("CursorIM");
      + if (id)
      + {
      + syn_id2colors(id, &fg, &bg);
      + if (bg)
      + color = bg - 1;
      + }
      + }
      + return color;
      +}
      +
      #endif /* FEAT_XIM */

      #if defined(FEAT_MBYTE) || defined(PROTO)
    • Bram Moolenaar
      ... Looks good to me. I ll include it and separate the generic code from the system-specific code. Thanks! -- Nothing is fool-proof to a sufficiently
      Message 2 of 2 , May 2, 2001
      • 0 Attachment
        Nam SungHyun wrote:

        > This patch is for OnTheSpot method (only supported by GTK+ GUI).
        >
        > I stole the code from gui_w32.c.
        > If you want to change the cursor color while preediting,
        > set 'CursorIM' highlight group. For example,
        > :hi CursorIM guibg=DarkGreen guifg=NONE

        Looks good to me. I'll include it and separate the generic code from the
        system-specific code. Thanks!

        --
        Nothing is fool-proof to a sufficiently talented fool.

        /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
        ((( Creator of Vim - http://www.vim.org -- 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.