Skip to content

Commit 66c2fcd

Browse files
committed
Fix #1020
PR #1002 removed decoding of the mvim:// url query. Every query goes through decoding now, no exceptions.
1 parent 5e199f4 commit 66c2fcd

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/MacVim/MMAppController.m

+5-10
Original file line numberDiff line numberDiff line change
@@ -1752,31 +1752,26 @@ - (void)handleGetURLEvent:(NSAppleEventDescriptor *)event
17521752
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
17531753
f = [f stringByRemovingPercentEncoding];
17541754
#else
1755-
f = [f stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
1755+
f = [f stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
17561756
#endif
17571757

17581758
// parse value
17591759
NSString *v = [arr objectAtIndex:1];
17601760

1761-
// do not decode url, since it's a file URI
1762-
BOOL decode = ![f isEqualToString:@"url"];
1763-
if (decode)
1764-
{
17651761
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
1766-
v = [f stringByRemovingPercentEncoding];
1762+
v = [v stringByRemovingPercentEncoding];
17671763
#else
1768-
v = [f stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
1764+
v = [v stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
17691765
#endif
1770-
}
17711766

1772-
[dict setValue:v forKey:f];
1767+
[dict setValue:v forKey:f];
17731768
}
17741769
}
17751770

17761771
// Actually open the file.
17771772
NSString *file = [dict objectForKey:@"url"];
17781773
if (file != nil) {
1779-
NSURL *fileUrl= [NSURL URLWithString:file];
1774+
NSURL *fileUrl = [NSURL URLWithString:file];
17801775
// TextMate only opens files that already exist.
17811776
if ([fileUrl isFileURL]
17821777
&& [[NSFileManager defaultManager] fileExistsAtPath:

0 commit comments

Comments
 (0)