IM turns off after preedit Japanese text

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

IM turns off after preedit Japanese text

Takuhiro Nishioka

Hi,

I'm using Vim 7.1 (patched 1-229) with SCIM 1.4.0 (Anthy) for Japanese
inputting.
After I preedit Japanese text, iminsert automatically turns off,
though I want to
continue inputting Japanese.

I don't understand well, but the following patch fixes the problem.

Index: mbyte.c
===================================================================
RCS file: /cvsroot/vim/vim7/src/mbyte.c,v
retrieving revision 1.61
diff -u -r1.61 mbyte.c
--- mbyte.c 6 Jan 2008 16:18:39 -0000 1.61
+++ mbyte.c 5 Feb 2008 04:22:41 -0000
@@ -3684,7 +3684,9 @@
     preedit_start_col = MAXCOL;
     xim_has_preediting = FALSE;

+#if 0
     im_is_active = FALSE;
+#endif
     gui_update_cursor(TRUE, FALSE);
     im_show_info();
 }

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_multibyte" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: IM turns off after preedit Japanese text

Bram Moolenaar


Takuhiro Nishioka wrote:

> I'm using Vim 7.1 (patched 1-229) with SCIM 1.4.0 (Anthy) for Japanese
> inputting.
> After I preedit Japanese text, iminsert automatically turns off,
> though I want to
> continue inputting Japanese.
>
> I don't understand well, but the following patch fixes the problem.
>
> Index: mbyte.c
> ===================================================================
> RCS file: /cvsroot/vim/vim7/src/mbyte.c,v
> retrieving revision 1.61
> diff -u -r1.61 mbyte.c
> --- mbyte.c 6 Jan 2008 16:18:39 -0000 1.61
> +++ mbyte.c 5 Feb 2008 04:22:41 -0000
> @@ -3684,7 +3684,9 @@
>      preedit_start_col = MAXCOL;
>      xim_has_preediting = FALSE;
>
> +#if 0
>      im_is_active = FALSE;
> +#endif
>      gui_update_cursor(TRUE, FALSE);
>      im_show_info();
>  }

I can't say I understand the details either.  The  im_is_active  flag is
supposed to keep track if wetther the input method is active, thus that
typed characters are used for the input method, not directly inserted
into the text.  Perhaps your input method is different, in that it
remains active after finishing a character?  I wonder why it has worked
OK for others so far.  Another possibility is that im_preedit_start_cb()
is called for other input methods but not for yours.

This is with GTK 2, right?

--
Contrary to popular belief, it's often your clothing that gets promoted, not
you.
                                (Scott Adams - The Dilbert principle)

 /// Bram Moolenaar -- [hidden email] -- 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    ///

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_multibyte" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: IM turns off after preedit Japanese text

Takuhiro Nishioka

Hi,

Yes, Vim with GTK2 on Fedora Core 6.

I don't have the Linux environment here, so I'll check through more in a few
days.

The following is what I discovered until now.

With the patch, Japanese inputting process is like follows

1. I start Vim
2. I swith to insert mode
3. IM on
4. I start preediting Japanese text (type some key)
5. preedit_start_cb
6. I preedit Japanese text
7. I end preediting Japanese text
8. preedit_end_cb
9. Japanese text is inserted to Vim's buffer
10. I start preediting Japanese text again (type some key)
11. preedit_start_cb
12. I preedit Japanese text
...

Without the patch:

1. I start Vim
2. I swith to insert mode
3. IM on
4. I start preediting Japanese text
5. preedit_start_cb
6. I preedit Japanese text
7. I end preediting Japanese text
8. preedit_end_cb
9. IM turns off on Vim (IM can be turned on again using i_CTRL-^)
9. Japanese text is inserted to Vim's buffer
10. type some key doesn't invoke preedit_start_cb

And when I switch back to normal mode, iminsert is reset to 0 (I was set it
to 2).

> Takuhiro Nishioka wrote:
>
>> I'm using Vim 7.1 (patched 1-229) with SCIM 1.4.0 (Anthy) for Japanese
>> inputting.
>> After I preedit Japanese text, iminsert automatically turns off,
>> though I want to
>> continue inputting Japanese.
>>
>> I don't understand well, but the following patch fixes the problem.
>>
>> Index: mbyte.c
>> ===================================================================
>> RCS file: /cvsroot/vim/vim7/src/mbyte.c,v
>> retrieving revision 1.61
>> diff -u -r1.61 mbyte.c
>> --- mbyte.c 6 Jan 2008 16:18:39 -0000 1.61
>> +++ mbyte.c 5 Feb 2008 04:22:41 -0000
>> @@ -3684,7 +3684,9 @@
>>      preedit_start_col = MAXCOL;
>>      xim_has_preediting = FALSE;
>>
>> +#if 0
>>      im_is_active = FALSE;
>> +#endif
>>      gui_update_cursor(TRUE, FALSE);
>>      im_show_info();
>>  }
>
> I can't say I understand the details either.  The  im_is_active  flag is
> supposed to keep track if wetther the input method is active, thus that
> typed characters are used for the input method, not directly inserted
> into the text.  Perhaps your input method is different, in that it
> remains active after finishing a character?  I wonder why it has worked
> OK for others so far.  Another possibility is that im_preedit_start_cb()
> is called for other input methods but not for yours.
>
> This is with GTK 2, right?



--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_multibyte" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---