summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-01-14 13:06:03 +0100
committerGitHub <noreply@github.com>2020-01-14 13:06:03 +0100
commit4d3acbcb3a18520909ed6e36c3f9b5e681c2eb74 (patch)
tree9d40641b058abbb3aedb30c1b35710e13ea1e36f
parent2f1be121b72fc2b0fb7ae10e8898978a27ef249b (diff)
parentbda9145aae3e50f1304e8faa2c7be0ce65feb4a5 (diff)
Merge pull request #35114 from timothyqiu/macos-ime
Fixes IME input backspace on macOS
-rw-r--r--platform/osx/os_osx.mm6
1 files changed, 5 insertions, 1 deletions
diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm
index 2b002d3b5d..6a214b8669 100644
--- a/platform/osx/os_osx.mm
+++ b/platform/osx/os_osx.mm
@@ -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]);