From fe5039c2780d57cc49655cd0735ee0e5ff427b1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sidney=20San=20Mart=C3=ADn?= Date: Wed, 17 Jul 2013 14:26:49 -0400 Subject: [PATCH] Don't double-encode URLs before parsing them wasn't a bug. When you're constructing a URL, you *should* end up escaping URL-unsafe characters twice: once for the `file:` URL and once for the `mvim:` URL. Escaping it inside MacVim breaks legit URLs with escapes at the `mvim:` level. --- src/MacVim/MMAppController.m | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/MacVim/MMAppController.m b/src/MacVim/MMAppController.m index a309292811..265ec677d2 100644 --- a/src/MacVim/MMAppController.m +++ b/src/MacVim/MMAppController.m @@ -1659,12 +1659,9 @@ fsEventCallback(ConstFSEventStreamRef streamRef, - (void)handleGetURLEvent:(NSAppleEventDescriptor *)event replyEvent:(NSAppleEventDescriptor *)reply { - NSString *urlString = [[event paramDescriptorForKeyword:keyDirectObject] - stringValue]; - // NOTE: URLWithString requires string to be percent escaped. - urlString = [urlString stringByAddingPercentEscapesUsingEncoding: - NSUTF8StringEncoding]; - NSURL *url = [NSURL URLWithString:urlString]; + NSURL *url = [NSURL URLWithString:[[event + paramDescriptorForKeyword:keyDirectObject] + stringValue]]; // We try to be compatible with TextMate's URL scheme here, as documented // at http://blog.macromates.com/2007/the-textmate-url-scheme/ . Currently,