Yee Cheng Chin 653366fb23 Fix mvim:// protocol double-encoding behavior handling properly
Change mvim:// protocol behavior back to previous state to double-encode
the file path, since we are encapsulating a file:// protocol (which has
encoded path) within another URL as a query, which itself should be
encoded. This means a file path "/tmp/file name.txt" should be properly
encoded as mvim://open?url=file:///tmp/file%2520name.txt, as the space
is encoded twice (first to %20, then to %2520).

Previously we tried to fix the protocol handler to only do a single
encoding (see #1021 and #1043) but it's really an incorrect usage of
URL. The reason for that fix was that tools like iTerm2 was passing in
single-encoded URLs. As such, also add a compatibility feature here
where we will optimiscally try to re-encode characters that we detect to
be erroneously encoded. For example, if we see
mvim://open?url=file:///tmp/file%20name.txt, MacVim will intelligently
realize that the space needs to be encoded again. The only character
where that won't work is the "%" character because of the ambiguity
involved, so a file path "/tmp/file%.txt" will only work with this:
mvim://open?url=file:///tmp/file%2525.txt

Close #1020 (also see the issue for discussions).
2020-07-05 23:30:44 -07:00
2020-05-17 15:17:26 +02:00
2020-05-27 18:41:27 +09:00

Vim - the text editor - for macOS

Description
Vim - the text editor - for macOS
Readme 231 MiB
Languages
Vim Script 52.2%
C 37.7%
Objective-C 3.2%
Roff 1.7%
Makefile 1.2%
Other 3.2%