Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add IME preedit ranges #261

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Add IME preedit ranges #261

wants to merge 1 commit into from

Conversation

Riateche
Copy link
Contributor

@Riateche Riateche commented Jun 8, 2024

Added SetPreedit action that inserts text with a special is_preedit flag in the attributes and clears any previous preedit. This is the most straightforward way to show a preedit inline, so that it works naturally with shaping and word wrapping. The downside is that the buffer's text is not the same as the document text anymore. For example, if the user wants to retrieve the text from the buffer, they should delete the part corresponding to the preedit (or clear the preedit). To help with this, I added Buffer::text_without_preedit() and BufferLine::text_without_preedit().

I've added IME support to the editor example to demonstrate the correct handling of IME.

@Riateche
Copy link
Contributor Author

Rebased onto main and fixed a CI issue with no_std. Please take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant