Menu

#1476 GTK: Add support for IME context

Committed
closed
nobody
5
2025-05-11
2023-01-28
No

Here is a patch adding support for answering queries from GTK input methods to retrieve or alter the text surrounding the caret. This is a feature used by more sophisticated input methods either to improve their context awareness (e.g. not allowing inputting invalid character sequences in languages with such restrictions, adjusting case depending on punctuation before the cursor, etc.) or improving context integration (e.g. when input should lead to combination, adjusting spacing, etc.).

Attached patch implements both for the GTK platform. Tested mainly with GTK 3.24.

To test, you could use a real input method that uses these features, or play with my toy for testing https://github.com/b4n/ibus-caesar (beware, it's annoying to type like that -- you can comment-out the ciphering of characters as you type, less annoying).

1 Attachments

Discussion

  • Neil Hodgson

    Neil Hodgson - 2023-01-28
    • labels: ime, gtk --> ime, gtk, scintilla
    • Group: Initial --> Committed
     
  • Neil Hodgson

    Neil Hodgson - 2023-01-28

    Committed as [2cdc4e].

     

    Related

    Commit: [2cdc4e]

  • Neil Hodgson

    Neil Hodgson - 2023-02-07
    • status: open --> closed
     
  • johnsonj

    johnsonj - 2025-05-05

    surrounding code serialized.

    To do :

    1. handle preedit string
    2. set candidate box position
    3. handle selection
     
    • Neil Hodgson

      Neil Hodgson - 2025-05-06

      Committed as [2cc4d2].

       

      Related

      Commit: [2cc4d2]

    • johnsonj

      johnsonj - 2025-05-06

      We can handle preedit string in line as it is.
      Surrounding deleted should be blocked from reviving.

      bug : surrounding deleted revives
      https://youtu.be/H_XtMgslYcM

      solve : tentativeUndo in advance
      https://youtu.be/rlXIKl4CW7g

       

      Last edit: johnsonj 2025-05-06
      • Neil Hodgson

        Neil Hodgson - 2025-05-11

        Committed as [24d898].

         

        Related

        Commit: [24d898]


Log in to post a comment.

MongoDB Logo MongoDB