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

:set iminsert=2 not working in Korean IME

Expand Messages
  • Sangpil Yoon [sangpil]
    Hello, I found that iminsert option is not working when Korean IME is active. When using Japanese IME, it worked fine. Here is the patch for this problem: diff
    Message 1 of 7 , Aug 13, 2003
      Hello,

      I found that iminsert option is not working when Korean IME is active.
      When using Japanese IME, it worked fine.
      Here is the patch for this problem:

      diff -c -r1.94 gui_w32.c
      *** gui_w32.c 26 Jul 2003 15:58:34 -0000 1.94
      --- gui_w32.c 13 Aug 2003 04:30:23 -0000
      ***************
      *** 252,257 ****
      --- 252,258 ----
      BOOL (WINAPI *pImmSetCompositionFont)(HIMC, LPLOGFONTA);
      BOOL (WINAPI *pImmSetCompositionWindow)(HIMC, LPCOMPOSITIONFORM);
      BOOL (WINAPI *pImmGetConversionStatus)(HIMC, LPDWORD, LPDWORD);
      + BOOL (WINAPI *pImmSetConversionStatus)(HIMC, DWORD, DWORD);
      static void dyn_imm_load(void);
      #else
      # define pImmGetCompositionStringA ImmGetCompositionStringA
      ***************
      *** 265,270 ****
      --- 266,272 ----
      # define pImmSetCompositionFont ImmSetCompositionFontA
      # define pImmSetCompositionWindow ImmSetCompositionWindow
      # define pImmGetConversionStatus ImmGetConversionStatus
      + # define pImmSetConversionStatus ImmSetConversionStatus
      #endif

      #ifndef ETO_IGNORELANGUAGE
      ***************
      *** 1441,1447 ****
      --- 1443,1457 ----
      hImc = pImmGetContext(s_hwnd);
      if (hImc)
      {
      + DWORD fdwConversion, fdwSentence;
      +
      pImmSetOpenStatus(hImc, active);
      + pImmGetConversionStatus(hImc, &fdwConversion, &fdwSentence);
      + pImmSetConversionStatus(hImc,
      + active ?
      + (fdwConversion | IME_CMODE_NATIVE) :
      + (fdwConversion & ~IME_CMODE_NATIVE),
      + fdwSentence);
      pImmReleaseContext(s_hwnd, hImc);
      }
      }
    • MURAOKA Taro
      I object to your patch, because of two reasons. First, it is not enough for dyn/ime. But it is easy to fix. Second, it has a bad side effect for Japanese
      Message 2 of 7 , Aug 14, 2003
        I object to your patch, because of two reasons. First, it is not enough
        for dyn/ime. But it is easy to fix. Second, it has a bad side effect
        for Japanese user. With your patch, after set imi=0, enter insert mode
        and start IME with the key type, then IME has "ZENKAKU EISU" input
        mode. We Japanese will expect to keep previous input mode "HIRAGANA"
        when toggle on IME.

        I wrote a new patch to fix these two point. Please try this.
        ----
        MURAOKA Taro <koron@...>
      • Sangpil Yoon [sangpil]
        ... Sorry about that, I didn t know that. ... I tried your patch, but it had another problem for Korean IME. :( When exiting from insert mode, it is expected
        Message 3 of 7 , Aug 14, 2003
          > I object to your patch, because of two reasons. First, it is not enough
          > for dyn/ime. But it is easy to fix. Second, it has a bad side effect
          > for Japanese user. With your patch, after set imi=0, enter insert mode
          > and start IME with the key type, then IME has "ZENKAKU EISU" input
          > mode. We Japanese will expect to keep previous input mode "HIRAGANA"
          > when toggle on IME.

          Sorry about that, I didn't know that.

          > I wrote a new patch to fix these two point. Please try this.

          I tried your patch, but it had another problem for Korean IME. :(
          When exiting from insert mode, it is expected that the conversion mode
          is set to non-native mode, so that you can enter vim commands without having to
          toggle the conversion mode, but after I applied your patch it didn't switch to
          non-native mode. :(

          So I fixed this again based on your patch. This time I've added a macro
          _IS_KOREAN() which returns nonzero if the current keyboard layout is
          korean and made IME_CMODE_NATIVE unset based on this return value.

          Regards,
          Sangpil Yoon
        • MURAOKA Taro
          ... No problem. ... Yes, it seems good for me. But to make it surely and safely, we should control conversion-status for only Korean. Please check attached
          Message 4 of 7 , Aug 14, 2003
            > Sorry about that, I didn't know that.

            No problem.

            > So I fixed this again based on your patch. This time I've added a macro
            > _IS_KOREAN() which returns nonzero if the current keyboard layout is
            > korean and made IME_CMODE_NATIVE unset based on this return value.

            Yes, it seems good for me. But to make it surely and safely, we should
            control conversion-status for only Korean. Please check attached patch
            for details.
            ----
            MURAOKA Taro <koron@...>
          • Bram Moolenaar
            ... I m glad you are checking these changes and proposing a correction. I find it strange that an exception is made for one language. I don t see why Korean
            Message 5 of 7 , Aug 14, 2003
              Taro Muraoka wrote:

              > > Sorry about that, I didn't know that.
              >
              > No problem.
              >
              > > So I fixed this again based on your patch. This time I've added a macro
              > > _IS_KOREAN() which returns nonzero if the current keyboard layout is
              > > korean and made IME_CMODE_NATIVE unset based on this return value.
              >
              > Yes, it seems good for me. But to make it surely and safely, we should
              > control conversion-status for only Korean. Please check attached patch
              > for details.

              I'm glad you are checking these changes and proposing a correction.

              I find it strange that an exception is made for one language. I don't
              see why Korean is so special that we need to make an exception for it.
              Isn't this rather connected to the specific IME used?

              Or does the other patch already take care of this?

              --
              Birthdays are healthy. The more you have them, the longer you live.

              /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
              /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\
              \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
              \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html ///
            • Sangpil Yoon [sangpil]
              ... Due to a bug in Korean IME. ImmSetOpenStatus() call has no effect in Korea IME. I ve confirmed that this bug exists in Windows 98 and 2000, but have no
              Message 6 of 7 , Aug 14, 2003
                > I find it strange that an exception is made for one language. I don't
                > see why Korean is so special that we need to make an exception for it.

                Due to a bug in Korean IME. ImmSetOpenStatus() call has no effect in
                Korea IME. I've confirmed that this bug exists in Windows 98 and 2000,
                but have no idea whether this is the case on other windows variants.

                > Isn't this rather connected to the specific IME used?

                Yes it is. But aren't these kind of things what we programmers always do? ;)

                Regards,
                Sangpil Yoon
              • Bram Moolenaar
                ... Over the years many small changes have been made to the multi-byte code to handle exceptions. The code is getting more and more complicated, while there
                Message 7 of 7 , Aug 15, 2003
                  Sangpil Yoon wrote:

                  > > I find it strange that an exception is made for one language. I don't
                  > > see why Korean is so special that we need to make an exception for it.
                  >
                  > Due to a bug in Korean IME. ImmSetOpenStatus() call has no effect in
                  > Korea IME. I've confirmed that this bug exists in Windows 98 and 2000,
                  > but have no idea whether this is the case on other windows variants.
                  >
                  > > Isn't this rather connected to the specific IME used?
                  >
                  > Yes it is. But aren't these kind of things what we programmers always do? ;)

                  Over the years many small changes have been made to the multi-byte code
                  to handle exceptions. The code is getting more and more complicated,
                  while there is no person that understands how it all works. Mostly to
                  be blamed on every language/IME to introduce its own problems.

                  We should keep in mind that the situation of people on different
                  computers may cause various side effects of a code change. Therefore we
                  must be as specific as we can and try to situations where it would
                  _not_ work. For example, suppose that someone installs an IME that does
                  work correctly, how does the code change affect him?

                  The least we need to do is add a comment to the changed code that
                  explains why it is done this way. That is very useful when solving
                  another problem later.

                  --
                  hundred-and-one symptoms of being an internet addict:
                  141. You'd rather go to http://www.weather.com/ than look out your window.

                  /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
                  /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\
                  \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
                  \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html ///
                Your message has been successfully submitted and would be delivered to recipients shortly.