diff options
Diffstat (limited to 'platform/osx/os_osx.mm')
-rw-r--r-- | platform/osx/os_osx.mm | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index 95c103bd28..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]); @@ -2111,6 +2115,19 @@ String OS_OSX::get_cache_path() const { } } +String OS_OSX::get_bundle_resource_dir() const { + + NSBundle *main = [NSBundle mainBundle]; + NSString *resourcePath = [main resourcePath]; + + char *utfs = strdup([resourcePath UTF8String]); + String ret; + ret.parse_utf8(utfs); + free(utfs); + + return ret; +} + // Get properly capitalized engine name for system paths String OS_OSX::get_godot_dir_name() const { |