-
-
Notifications
You must be signed in to change notification settings - Fork 552
feat: add Lua API of IME event handling #3110
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
base: main
Are you sure you want to change the base?
Conversation
Thank you, I will take a look at this a bit later (in a few days) It's possible that it would make sense to just implement the base API in Neovide, and implement the rest in a separate plugin for easier development, and possible faster updates. But I'm not sure yet. |
I don't know what you're unsure about, but there are plugins like equalsraf/neovim-gui-shim that separate GUI-related functions. I can't say that it works stably yet, so separating it as a plugin would probably be better in terms of development. Also, regarding handling IME with a plugin, in terms of performance, the focus is on the implementation using NeoVim's autocommands rather than on plugin loading. Anyway, if you're going to merge only the base API, please let me know so I can make the change. |
Hi! I build and use your commit id: e58082d I try to insert mode with ime input at 3rd lines. And I use direction keys move cursor. Is freeze status. Press Enter key is not response. |
@chyuaner,Thank you for reporting! |
I Record Screen. And found another bug!
Video_2025-04-22_22-42-15.mp4Back to yesterday's question.
I try to insert mode with ime input at 3rd lines. Video_2025-04-22_22-43-27.mp4
|
Regarding the swapfile issue, it looks like Neovim is either not responding at all, or crashed. It's possible that it's caused by something else and not these changes, @chyuaner, are you able to reproduce it without? |
I change neovide version to Arch Linux Pacman Package: neovide-0.15.0-1. Video_2025-04-22_23-36-58.mp4All hint text is show half one second and disappeared. |
I think, I know what's wrong with the hang. This PR tries to execute autocommands, which probably isn't supported when a message is showing. Perhaps a more explicit lua API with callbacks could be created. We don't have much yet, but it can and will be extended. For example, the image support will also provide an API. And even then, it's possible that the lua side, has to disable some things, like actually showing the pre-edit. You might be able to reproduce this by simply opening a confirm dialog https://neovim.io/doc/user/builtin.html#confirm() |
I will change my policy to implement a Lua API. I intend to separate the pre-edit preview and other functions into a separate plugin. |
Default action is to insert commited text after the cursor. And, you can customize the behavior when preeditted or committed.
Default action is to insert commited text after the cursor. And, you can customize the behavior when preeditted or committed.
I separated it into a Lua API and a plugin that supports pre-edit. However, since the plugin only transferred what was written when opening pull request, I would like to address the problem there. |
What kind of change does this PR introduce?
Did this PR introduce a breaking change?
A breaking change includes anything that breaks backwards compatibility either at compile or run time.
About
This pull request introduces support for handling IME (Input Method Editor) preedit and commit events in Neovide, enabling better text input for languages requiring complex input methods. The changes include adding Lua scripts for IME handling, modifying the Rust backend to integrate with these scripts, and updating the keyboard manager to process IME-specific events.
Related to #1931
Sample
2025-04-18-neovide-ime.mp4