[vim/vim] netrw: Fix gx command (#7188)

75 views
Skip to first unread message

K.Takata

unread,
Oct 22, 2020, 7:21:45 PM10/22/20
to vim/vim, Subscribed

Fix #4738.
Since Netrw v165, the gx command had been broken at least on macOS and
MS-Windows. The platform-specific open commands support to handle a
remote URL directly, however, Netrw downloaded a file first.

Stop downloading a remote file when the viewer supports to handle a
remote URL.


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/7188

Commit Summary

  • netrw: Fix gx command

File Changes

Patch Links:


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

Charles Campbell

unread,
Oct 22, 2020, 9:39:45 PM10/22/20
to vim...@googlegroups.com
K.Takata (Vim Github Repository) wrote:
>
> Fix #4738 <https://github.com/vim/vim/issues/4738>.
> Since Netrw v165, the gx command had been broken at least on macOS and
> MS-Windows. The platform-specific open commands support to handle a
> remote URL directly, however, Netrw downloaded a file first.
>
> Stop downloading a remote file when the viewer supports to handle a
> remote URL.
>
Hello, K Takata:

I confess that I'm not a git master.  It'd be a help if you could send
me a patch instead of a commit which I don't use, or inform me of the
git command to download the file separately so I can diff and study it.
I can see a nice pretty set of changes which is almost a diff, but I
hate applying these things manually.  Iffy process, that.

Thanks,
Chip Campbell

James McCoy

unread,
Oct 22, 2020, 9:58:04 PM10/22/20
to vim_dev
On Thu, Oct 22, 2020, 21:39 Charles Campbell <camp...@drchip.org> wrote:
I confess that I'm not a git master.  It'd be a help if you could send
me a patch instead of a commit which I don't use

If you append ".diff" to a pull request URL, you get a diff you can download.  For example, https://github.com/vim/vim/pull/7188.diff

Cheers,
James

Nick Jensen

unread,
Oct 22, 2020, 9:58:38 PM10/22/20
to vim...@googlegroups.com
The 2020-10-22 21:39, Charles Campbell wrote:
>I confess that I'm not a git master.  It'd be a help if you could send
>me a patch instead of a commit which I don't use, or inform me of the
>git command to download the file separately so I can diff and study
>it. I can see a nice pretty set of changes which is almost a diff, but
>I hate applying these things manually.  Iffy process, that.

There's a hint ("Pro Tip!") at the bottom of the github pull request
page indicating that you can add ".patch" or ".diff" to the end of the
URL:

https://github.com/vim/vim/pull/7188.patch
https://github.com/vim/vim/pull/7188.diff

Regards,
Nick Jensen

Bram Moolenaar

unread,
Oct 23, 2020, 9:07:50 AM10/23/20
to vim...@googlegroups.com, Nick Jensen
It is SO annoying that there is no link for this at the top.
Even if you go to "files changed", which shows a nicely highlighted
version of the diff, the "raw diff" button is missing. Pretty bad UI.

--
hundred-and-one symptoms of being an internet addict:
114. You are counting items, you go "0,1,2,3,4,5,6,7,8,9,A,B,C,D...".

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Charles Campbell

unread,
Oct 24, 2020, 2:37:56 PM10/24/20
to vim...@googlegroups.com
Hello:

Unfortunately:

sphinx?   https://github.com/vim/vim/pull/7188.diff
ksh: https://github.com/vim/vim/pull/7188.diff: not found [No such
file or directory]
sphinx?   https://github.com/vim/vim/pull/7188.patch
ksh: https://github.com/vim/vim/pull/7188.patch: not found [No such
file or directory]

Regards,
Chip Campbell

Charles Campbell

unread,
Oct 24, 2020, 2:52:34 PM10/24/20
to vim...@googlegroups.com
Well, that was dumb on my part.  Here's a new and updated problem:

git pull  https://github.com/vim/vim/pull/7188.diff
fatal: Not a git repository (or any parent up to mount point /home)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

Again, I want to pull the diff/patch and not have it bother what I've
got. I need to check it over, run it through my test suite, merge it
with the latest netrw (at v171b at the moment).

Regards,
Chip Campbell

Ingo Karkat

unread,
Oct 24, 2020, 4:07:23 PM10/24/20
to vim...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Charles, that URL gives you a plain diff; download it via

$ curl -L https://github.com/vim/vim/pull/7188.diff

or simply open the URL in the browser and save the page as a text file.

You can also stay within Git, but then would have to set up Vim's
GitHub repository as a remote, pull it (Vim's GitHub page has all the
details behind the "Clone or download" button), and then you can diff
it there, but it would be way more complex, and not so useful, anyway,
as you maintain your plugin separately from what gets included by
Bram. (So sooner or later you'd still need to produce a diff to move
the changes over to your copy.)

Like Vim, Git has a steep initial learning curve (I've been there as
well); take your time!

- -- regards, ingo
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJflIlmAAoJEA7ziXlAzQ/vIWwH/Az1SjjjNbVwbp8+W7JE+t2J
tmEESsMPId38bO2qBe7jSXKXPZdvn/4twaW8JZuid35XxKVRUpC0RH44XiBYHlKB
XKe/3/h8HBPJuqUwPrnh7LiQzM3erkiDt0qo8QEovU3SueG5BGwAzWThcHamxoOn
DK2eTtz/f3ED91EU8RuZ5g6BvEYVVpLlSx5JQ42SyuuHi8HS4GoXIwE1CA2C0hUD
AMN+XBx8rVOQLKR+1rvfWb0UwgMgh4x7LEwf7Glonp0B3cvusoX05s0cT2xHtcrv
c7qCzjNB/99KgbRpsNahmre1JqUZ4b9Dd13ENhB9d9Dvmb6BpF8PzLU71jxqmt4=
=smqM
-----END PGP SIGNATURE-----

Dominique Pellé

unread,
Oct 24, 2020, 4:57:03 PM10/24/20
to vim/vim, Subscribed

@dpelle commented on this pull request.


In runtime/doc/pi_netrw.txt:

> @@ -1510,6 +1510,9 @@ Netrw determines which special handler by the following method:

     If g:netrw_browsex_viewer == '-', then netrwFileHandlers#Invoke() will be

     used instead (see |netrw_filehandler|).

 

+    If the viewer doesn't support to handle a remote URL directry, set

directry → directory

I'm not a native speaker, but grammar also does not look right. I think it should be:

If the viewer doesn't support handling of a remote URL directory, set …

Arseny Nasokin

unread,
Oct 25, 2020, 5:28:52 AM10/25/20
to vim/vim, Subscribed

@eirnym commented on this pull request.


In runtime/doc/pi_netrw.txt:

> @@ -1510,6 +1510,9 @@ Netrw determines which special handler by the following method:
     If g:netrw_browsex_viewer == '-', then netrwFileHandlers#Invoke() will be
     used instead (see |netrw_filehandler|).
 
+    If the viewer doesn't support to handle a remote URL directry, set

direclty was a good term here

Nick Jensen

unread,
Oct 26, 2020, 4:21:42 PM10/26/20
to vim/vim, Subscribed

@nickspoons commented on this pull request.


In runtime/doc/pi_netrw.txt:

> @@ -1510,6 +1510,9 @@ Netrw determines which special handler by the following method:

     If g:netrw_browsex_viewer == '-', then netrwFileHandlers#Invoke() will be

     used instead (see |netrw_filehandler|).

 

+    If the viewer doesn't support to handle a remote URL directry, set

I agree with @dpelle about the grammar, but suspect that @eirnym is correct (despite the spelling mistake 😄 ) in that the word we're after is "directly".

If the viewer doesn't support handling of a remote URL directly, set …

K.Takata

unread,
Oct 26, 2020, 7:51:43 PM10/26/20
to vim/vim, Push

@k-takata pushed 1 commit.


You are receiving this because you are subscribed to this thread.

View it on GitHub or unsubscribe.

K.Takata

unread,
Oct 26, 2020, 7:55:08 PM10/26/20
to vim/vim, Subscribed

@k-takata commented on this pull request.


In runtime/doc/pi_netrw.txt:

> @@ -1510,6 +1510,9 @@ Netrw determines which special handler by the following method:
     If g:netrw_browsex_viewer == '-', then netrwFileHandlers#Invoke() will be
     used instead (see |netrw_filehandler|).
 
+    If the viewer doesn't support to handle a remote URL directry, set

I meant "directly", but it can be removed.
Updated based on @nickspoons' suggestion.

Arseny Nasokin

unread,
Oct 27, 2020, 4:25:01 AM10/27/20
to vim/vim, Subscribed

@eirnym commented on this pull request.


In runtime/doc/pi_netrw.txt:

> @@ -1510,6 +1510,9 @@ Netrw determines which special handler by the following method:
     If g:netrw_browsex_viewer == '-', then netrwFileHandlers#Invoke() will be
     used instead (see |netrw_filehandler|).
 
+    If the viewer doesn't support to handle a remote URL directry, set

@nickspoons thanks, for a pointing me to a grammar mistake. Fast reading autocorrects grammar :)

K.Takata

unread,
Oct 18, 2021, 1:54:58 AM10/18/21
to vim/vim, Subscribed

It looks that this has been included in Netrw v171: 89a9c15


You are receiving this because you are subscribed to this thread.

Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.

K.Takata

unread,
Oct 18, 2021, 1:54:59 AM10/18/21
to vim/vim, Subscribed

Closed #7188.


You are receiving this because you are subscribed to this thread.

Reply all
Reply to author
Forward
0 new messages