I wrote a patch to enable http/ftp/webdav access with netrw on windows+shellslash. I'm using vim but not use cygwin or msys2. However, then editing http file on vim, URL is displayed as:
http:\\example.com\foo.html
So I want to use shellslash on windows too. Below is a patch to enable this.
https://gist.github.com/mattn/0799137eea35ed4e789d
Bram, I'm having one more idea to avoid this. It's keeping slash when the buffer name seems to be URL. How do you think?
- mattn
> No. patching vim. if okay, will make a patch.
There are two problem.
1. ":e http://www.google.com/" doesn't work on noshellslash.
2. URL is displayed as http:\\www.google.com\foo.html
1 should be fixed with my previous patch. I will update in later.
2 should be following patch.
diff --git a/src/fileio.c b/src/fileio.c
index 0f3f148..b4480d0 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -7555,6 +7555,8 @@ forward_slash(fname)
{
char_u *p;
+ if (path_with_url(fname))
+ return;
for (p = fname; *p != NUL; ++p)
# ifdef FEAT_MBYTE
/* The Big5 encoding can have '\' in the trail byte. */
diff --git a/src/os_win32.c b/src/os_win32.c
index 5114863..3c6cdbe 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -2731,6 +2731,8 @@ fname_case(
flen = (int)STRLEN(name);
if (flen == 0)
return;
+ if (path_with_url(name))
+ return;
slash_adjust(name);
seems still not. :e works fine but
C:\>vim http://www.google.com/index.html
This doesn't work.
Fixed.
diff --git a/src/fileio.c b/src/fileio.c
index 0f3f148..b4480d0 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -7555,6 +7555,8 @@ forward_slash(fname)
{
char_u *p;
+ if (path_with_url(fname))
+ return;
for (p = fname; *p != NUL; ++p)
# ifdef FEAT_MBYTE
/* The Big5 encoding can have '\' in the trail byte. */
diff --git a/src/os_mswin.c b/src/os_mswin.c
index b50b86c..29a1491 100644
--- a/src/os_mswin.c
+++ b/src/os_mswin.c
@@ -486,6 +486,8 @@ mch_isFullName(char_u *fname)
slash_adjust(p)
char_u *p;
{
+ if (path_with_url(p))
+ return;
while (*p)
{
if (*p == psepcN)