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

Re: XIM input status in vim6.0 [test patch]

Expand Messages
  • Bram Moolenaar
    ... Thanks for looking into this. I m not sure if using a v: variable for this is the best choice, but we can think about that later. You seem to be calling
    Message 1 of 6 , Apr 20, 2001
    • 0 Attachment
      Steven Mueller wrote:

      > I decided to look into setting up a vim variable v:preediting
      > (probably not the best of names...). Getting this working wasn't
      > difficult, but I can't seem to get the status line to refresh when
      > preedit mode is activated or deactivated.

      Thanks for looking into this. I'm not sure if using a v: variable for this is
      the best choice, but we can think about that later.

      You seem to be calling all the right functions. Perhaps it's a matter of
      calling out_flush() to get the text onto the screen? That might be needed,
      since Vim is waiting for characters and the functions are callbacks, thus we
      don't go through the normal loop that updates the screen.

      > Bram: how does this patch look to you? If you could point me in the
      > right direction for getting the status line to refresh properly, I'd
      > be greatly appreciative. I'm also open to suggestions on the name of
      > the added v:variable. I don't know if I'll be able to get very far on
      > any of the other suggestions I made, but I'll look into the cursor
      > change possibility.

      I think that setting 'statusline' to be able to see the XIM mode is a bit
      complicated for most people. But when this works we could find a simpler way.
      Either by adding it to the default status line, or showing it in another way.

      --
      Ten bugs in the hand is better than one as yet undetected.

      /// 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 ///
    • Nam SungHyun
      ... How about like this? Regards, namsh diff -u -p -r1.4 mbyte.c ... +++ ./mbyte.c 21 Apr 2001 00:29:38 -0000 @@ -2264,6 +2264,7 @@ static int
      Message 2 of 6 , Apr 20, 2001
      • 0 Attachment
        Bram Moolenaar wrote:
        >
        > Steven Mueller wrote:
        >
        > > I decided to look into setting up a vim variable v:preediting
        > > (probably not the best of names...). Getting this working wasn't
        > > difficult, but I can't seem to get the status line to refresh when
        > > preedit mode is activated or deactivated.
        >
        > Thanks for looking into this. I'm not sure if using a v: variable for
        > this is the best choice, but we can think about that later.

        How about like this?

        Regards,

        namsh

        diff -u -p -r1.4 mbyte.c
        --- ./mbyte.c 17 Apr 2001 00:42:33 -0000 1.4
        +++ ./mbyte.c 21 Apr 2001 00:29:38 -0000
        @@ -2264,6 +2264,7 @@ static int status_area_enabled = TRUE;
        static int xim_input_style;
        static gboolean use_status_area = 0;
        #endif
        +int xim_preediting = 0;

        void
        xim_set_focus(int focus)
        @@ -2925,6 +2926,12 @@ xim_decide_input_style()
        static void
        preedit_start_cbproc(XIC xic, XPointer client_data, XPointer call_data)
        {
        + xim_preediting = TRUE;
        + if (showmode())
        + {
        + setcursor();
        + out_flush();
        + }
        }

        static void
        @@ -3043,6 +3050,12 @@ preedit_caret_cbproc(XIC xic, XPointer c
        static void
        preedit_done_cbproc(XIC xic, XPointer client_data, XPointer call_data)
        {
        + xim_preediting = FALSE;
        + if (showmode())
        + {
        + setcursor();
        + out_flush();
        + }
        }

        void
        diff -u -p -r1.20.2.1 screen.c
        --- ./screen.c 18 Apr 2001 06:25:24 -0000 1.20.2.1
        +++ ./screen.c 21 Apr 2001 00:30:10 -0000
        @@ -7142,6 +7142,13 @@ showmode()
        if (do_mode)
        {
        MSG_PUTS_ATTR("--", attr);
        +#if defined(FEAT_XIM)
        + {
        + extern int xim_preediting;
        + if (xim_preediting)
        + MSG_PUTS_ATTR(" XIM", attr);
        + }
        +#endif
        #if defined(FEAT_HANGULIN) && defined(FEAT_GUI)
        if (gui.in_use)
        {
      • Bram Moolenaar
        ... Yes, I prefer this above using the statusline, because the statusline isn t always present. Still, when editing the command line there is no mode shown.
        Message 3 of 6 , Apr 21, 2001
        • 0 Attachment
          Nam SungHyun wrote:

          > Bram Moolenaar wrote:
          > >
          > > Steven Mueller wrote:
          > >
          > > > I decided to look into setting up a vim variable v:preediting
          > > > (probably not the best of names...). Getting this working wasn't
          > > > difficult, but I can't seem to get the status line to refresh when
          > > > preedit mode is activated or deactivated.
          > >
          > > Thanks for looking into this. I'm not sure if using a v: variable for
          > > this is the best choice, but we can think about that later.
          >
          > How about like this?

          Yes, I prefer this above using the statusline, because the statusline isn't
          always present.

          Still, when editing the command line there is no mode shown. This probably
          does require doing something with the cursor (color or shape). Or is there
          another way?

          I'll include this patch for now, we can further improve it later. I'll move
          the global variable to globals.h.

          --
          Microsoft's definition of a boolean: TRUE, FALSE, MAYBE
          "Embrace and extend"...?

          /// 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.