summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/macos.m7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/macos.m b/src/macos.m
index 9d46d84b..c6c30fa5 100644
--- a/src/macos.m
+++ b/src/macos.m
@@ -330,7 +330,10 @@ void enableMomentumScroll_MacOS(void) {
330- (void)handleURLEvent:(NSAppleEventDescriptor*)event 330- (void)handleURLEvent:(NSAppleEventDescriptor*)event
331 withReplyEvent:(NSAppleEventDescriptor*)replyEvent { 331 withReplyEvent:(NSAppleEventDescriptor*)replyEvent {
332 NSString *url = [[event paramDescriptorForKeyword:keyDirectObject] stringValue]; 332 NSString *url = [[event paramDescriptorForKeyword:keyDirectObject] stringValue];
333 postCommandf_App("~open url:%s", [url cStringUsingEncoding:NSUTF8StringEncoding]); 333 iString *str = newCStr_String([url cStringUsingEncoding:NSUTF8StringEncoding]);
334 str = urlDecodeExclude_String(collect_String(str), "/#?:");
335 postCommandf_App("~open url:%s", cstr_String(str));
336 delete_String(str);
334} 337}
335@end 338@end
336 339
@@ -512,7 +515,7 @@ void handleCommand_MacOS(const char *cmd) {
512 NSMenu *menu = mainMenuItem.submenu; 515 NSMenu *menu = mainMenuItem.submenu;
513 if (menu) { 516 if (menu) {
514 int itemIndex = 0; 517 int itemIndex = 0;
515 for (NSMenuItem *menuItem in menu.itemArray) { 518 for (NSMenuItem *menuItem in menu.itemArray) {
516 NSString *command = [myDel commandForItem:menuItem]; 519 NSString *command = [myDel commandForItem:menuItem];
517 if (!command && mainIndex == 6 && itemIndex == 0) { 520 if (!command && mainIndex == 6 && itemIndex == 0) {
518 /* Window > Close */ 521 /* Window > Close */