mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-06-30 12:53:14 +00:00
Clear marked text when text is inserted
This is apparently what Cocoa expects. Fixes committing pre-edit text no longer working.
This commit is contained in:
parent
bd4ed38a3c
commit
f34cc1861a
1 changed files with 1 additions and 0 deletions
|
|
@ -1524,6 +1524,7 @@ void _glfwPlatformUpdateIMEState(_GLFWwindow *w, const GLFWIMEUpdateEvent *ev) {
|
|||
{
|
||||
const char *utf8 = polymorphic_string_as_utf8(string);
|
||||
debug_key("\n\tinsertText: %s replacementRange: (%lu, %lu)\n", utf8, replacementRange.location, replacementRange.length);
|
||||
if ([self hasMarkedText]) [self unmarkText];
|
||||
// insertText can be called multiple times for a single key event
|
||||
char *s = _glfw.ns.text + strnlen(_glfw.ns.text, sizeof(_glfw.ns.text));
|
||||
snprintf(s, sizeof(_glfw.ns.text) - (s - _glfw.ns.text), "%s", utf8);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue