Menu

#1304 Avoid unnecessary IME caret moving

Committed
closed
5
2023-06-12
2019-07-15
Zufu Liu
No

Korean IME set CS_NOMOVECARET and CS_INSERTCHAR but not GCS_CURSORPOS, caret need be moved back to the beginning of input string.

Chinese IME and Japanese IME in input mode GetImeCaretPos() returns the length of input string, thus IME caret can be kept at end of input string without moving.

Japanese IME after pressing Tab replaces input string with first candidate item (target string); when selecting other candidate item, previous item will be replaced with current one.
After candidate item been added, it's looks like been full selected, it's better to keep caret at end of "selection" (end of input) instead of jump to beginning of input / "selection".

See related discussions on [feature-requests:#1300]
https://sourceforge.net/p/scintilla/feature-requests/1300/?page=2&limit=25#c3aa
https://sourceforge.net/p/scintilla/feature-requests/1300/?page=3&limit=25#866a

Related

Bugs: #2135
Bugs: #2390
Bugs: #2392
Feature Requests: #1300

Discussion

  • Zufu Liu

    Zufu Liu - 2019-07-15
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -5,6 +5,6 @@
     Japanese IME after pressing Tab replaces input string with first candidate item (target string); when selecting other candidate item, previous item will be replaced with current one.
     After candidate item been added, it's looks like been full selected, it's better to keep caret at end of "selection" (end of input) instead of jump to beginning of input / "selection".
    
    -See related discussions on [features:#1300]
    +See related discussions on [feature-requests:#1300]
     https://sourceforge.net/p/scintilla/feature-requests/1300/?page=2&limit=25#c3aa
     https://sourceforge.net/p/scintilla/feature-requests/1300/?page=3&limit=25#866a
    
     

    Related

    Feature Requests: #1300

  • Zufu Liu

    Zufu Liu - 2019-10-19

    Patch as previous discussed use std::all_of().

     
  • Neil Hodgson

    Neil Hodgson - 2019-10-29
    • Group: Completed --> Committed
     
  • Neil Hodgson

    Neil Hodgson - 2019-10-29

    Committed as [124907].

     

    Related

    Commit: [124907]

  • Zufu Liu

    Zufu Liu - 2019-11-01

    Fix typo.

     
  • johnsonj

    johnsonj - 2019-11-10

    I see this patch too late.
    I for korean do not care aboutCS_NOMOVECARET
    What is it in need for?
    for japanese or korean?

     
    • Zufu Liu

      Zufu Liu - 2019-11-10

      For japanese IME.

       
      • Zufu Liu

        Zufu Liu - 2019-11-10

        Mainly for Japanese IME. it not affect Korean IME, which set CS_NOMOVECARET, so move back to the front of composition string.

         
        • johnsonj

          johnsonj - 2023-06-10

          What benefits does japanese ime get from csnomovecaret?

           
  • Neil Hodgson

    Neil Hodgson - 2019-12-07
    • status: open --> closed
     
  • Neil Hodgson

    Neil Hodgson - 2019-12-07

    Committed as [124907].

     

    Related

    Commit: [124907]

  • johnsonj

    johnsonj - 2023-05-03

    This is not related the code impmented.
    I just leave a fact check for after runners.

    "Korean IME set CS_NOMOVECARET and CS_INSERTCHAR but not GCS_CURSORPOS, caret need be moved back to the beginning of input string."

    No, Korean need not to be moved back. see Qt and Gtk.

    "Chinese IME and Japanese IME in input mode GetImeCaretPos() returns the length of input string, thus IME caret can be kept at end of input string without moving."

    No, GetImeCaretPos() returns GCS_CURSORPOS, and GCS_CURSORPOS is not always the entire length, IME caret should be located at GCS_CURSORPOS, NOT the end of composition string.

    Japanese IME after pressing Tab replaces input string with first candidate item (target string); when selecting other candidate item, previous item will be replaced with current one.
    After candidate item been added, it's looks like been full selected, it's better to keep caret at end of "selection" (end of input) instead of jump to beginning of input / "selection".

    NO, keep ime caret at GCS_CURSORPOS.
    We should just take into consideration whether it is normal input of block input.
    NOT japanese, chinese or korean.

    ** Ignore CS_NOMOVECARET, Keep ime caret at GCS_CURSORPOS.**

     
  • johnsonj

    johnsonj - 2023-05-12

    If there is any block input, caret position get meaningless. so drop and hide caret.
    You can not see caret. This is a rule or principle.
    They does not follow Ime protocol.

    You do not have to follow them.
    It is enough to take it into consideration

    You can see their own inconsitency on MS edge :
    1. address window : following the rule. no caret indicating block input
    2. search window : break the rule. last caret shown confusing which mode input is in : normal or block input?

     
  • johnsonj

    johnsonj - 2023-05-13

    address window : legacy Ime
    search window : using TSF

     
  • johnsonj

    johnsonj - 2023-06-10

    There is no unnecessary ime caret moving!
    How complicated, inefficent!
    There add two buggy if check and one unnecessary if check.

     
    • Zufu Liu

      Zufu Liu - 2023-06-10

      Without the change Japanese IME on complete, caret will jump from start to end.

       
      • johnsonj

        johnsonj - 2023-06-11

        please be specific.
        I want to reproduce the case.

         
        • Zufu Liu

          Zufu Liu - 2023-06-11

          With imeWin32.patch on Win10 with MS Japanese IME:
          1. type katana
          2. press Space (caret move to front of 刀)
          3. press Enter (caret jump to end of 刀)

          in Windows Notepad, caret is always kept at end of 刀.

           
          • johnsonj

            johnsonj - 2023-06-11

            scintillaWin ime seems to suffer seriously recent japanese ime with TSF.
            Caret position is very important for debugging visually.
            I will put off this force until I know of something about TSF.

             
          • johnsonj

            johnsonj - 2023-06-11

            I forgot leaving comment.
            Do you move Ime caret based on other app?
            Ime Caret should be moved based on caret position pointed by IME.

             
            • Zufu Liu

              Zufu Liu - 2023-06-11

              More or less Windows Notepad.

               
  • johnsonj

    johnsonj - 2023-06-12

    Today I installed IME again.
    Now It seems TSF to be synchronize with IMM32.
    Scitilla works as expected as it follows IMM32.
    1. no partial commit.
    2. no inBlock input.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.