vim v8.1.1714 introduced a huge regression that basically made gx unusable (see issue #4738) thanks to 85850f3a5 (Update runtime files, 2019-07-19).
The gx mapping used to call CheckIfRemote() which always returned 0, When vim was updated to version 165 it was changed to CheckIfRemote(netrw#GX()), which for any links (e.g. http) returned 1. This caused netrw to download the URL first, and then open the file, which is clearly wrong and caused many issues. In the most recent version (171g) Campbell introduced a new configuration variable `netrw_browsex_support_remote` which can be set to 0 to induce the new behavior, but otherwise the old behavior is kept. This was backported from Charles Campbell's site (after the server finally decided to serve me). Fixes #4738. [1] http://www.drchip.org/astronaut/vim/index.html#NETRW Original-code-by: Charles E Campbell <[email protected]> Signed-off-by: Felipe Contreras <[email protected]> --- runtime/autoload/netrw.vim | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim index d095f6dd8..8ec46eed5 100644 --- a/runtime/autoload/netrw.vim +++ b/runtime/autoload/netrw.vim @@ -5264,6 +5264,12 @@ fun! netrw#BrowseX(fname,remote) endif " call Decho("not a local file nor a webpage request",'~'.expand("<slnum>")) + if exists("g:netrw_browsex_viewer") && exists("g:netrw_browsex_support_remote") && !g:netrw_browsex_support_remote + let remote = a:remote + else + let remote = 0 + endif + let ykeep = @@ let screenposn = winsaveview() " call Decho("saving posn to screenposn<".string(screenposn).">",'~'.expand("<slnum>")) @@ -5308,9 +5314,9 @@ fun! netrw#BrowseX(fname,remote) endif " call Decho("exten<".exten.">",'~'.expand("<slnum>")) - if a:remote == 1 + if remote == 1 " create a local copy -" call Decho("remote: a:remote=".a:remote.": create a local copy of <".a:fname.">",'~'.expand("<slnum>")) +" call Decho("remote: remote=".remote.": create a local copy of <".a:fname.">",'~'.expand("<slnum>")) setl bh=delete call netrw#NetRead(3,a:fname) " attempt to rename tempfile @@ -5332,7 +5338,7 @@ fun! netrw#BrowseX(fname,remote) let fname= s:netrw_tmpfile endif else -" call Decho("local: a:remote=".a:remote.": handling local copy of <".a:fname.">",'~'.expand("<slnum>")) +" call Decho("local: remote=".remote.": handling local copy of <".a:fname.">",'~'.expand("<slnum>")) let fname= a:fname " special ~ handler for local if fname =~ '^\~' && expand("$HOME") != "" @@ -5475,12 +5481,12 @@ fun! netrw#BrowseX(fname,remote) " return to prior buffer (directory listing) " Feb 12, 2008: had to de-activiate removal of " temporary file because it wasn't getting seen. -" if a:remote == 1 && fname != a:fname +" if remote == 1 && fname != a:fname "" call Decho("deleting temporary file<".fname.">",'~'.expand("<slnum>")) " call s:NetrwDelete(fname) " endif - if a:remote == 1 + if remote == 1 setl bh=delete bt=nofile if g:netrw_use_noswf setl noswf -- 2.32.0.rc0 -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/20210530201146.65881-1-felipe.contreras%40gmail.com.
