1
0
mirror of https://github.com/godotengine/godot.git synced 2026-01-05 19:31:35 +00:00

Merge pull request #35114 from timothyqiu/macos-ime

Fixes IME input backspace on macOS
This commit is contained in:
Rémi Verschelde
2020-01-14 13:06:03 +01:00
committed by GitHub

View File

@@ -479,7 +479,7 @@ static const NSRange kEmptyRange = { NSNotFound, 0 };
}
- (NSRange)markedRange {
return (markedText.length > 0) ? NSMakeRange(0, markedText.length - 1) : kEmptyRange;
return NSMakeRange(0, markedText.length);
}
- (NSRange)selectedRange {
@@ -492,6 +492,10 @@ static const NSRange kEmptyRange = { NSNotFound, 0 };
} else {
[markedText initWithString:aString];
}
if (markedText.length == 0) {
[self unmarkText];
return;
}
if (OS_OSX::singleton->im_active) {
imeInputEventInProgress = true;
OS_OSX::singleton->im_text.parse_utf8([[markedText mutableString] UTF8String]);