From 9cc8064864374cf85c4273299d42094e3c687941 Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Wed, 4 Sep 2019 15:51:01 +0200 Subject: netrw.vim: workaround gx bug #10938 ref vim/vim#4738 --- runtime/plugin/netrwPlugin.vim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'runtime') diff --git a/runtime/plugin/netrwPlugin.vim b/runtime/plugin/netrwPlugin.vim index e39bde88a7..2d67f6a4e4 100644 --- a/runtime/plugin/netrwPlugin.vim +++ b/runtime/plugin/netrwPlugin.vim @@ -47,9 +47,9 @@ augroup Network au FileReadCmd ftp://*,rcp://*,scp://*,http://*,file://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau FileReadPre ".fnameescape(expand(""))|call netrw#Nread(1,expand(""))|exe "sil doau FileReadPost ".fnameescape(expand("")) au BufWriteCmd ftp://*,rcp://*,scp://*,http://*,file://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau BufWritePre ".fnameescape(expand(""))|exe 'Nwrite '.fnameescape(expand(""))|exe "sil doau BufWritePost ".fnameescape(expand("")) au FileWriteCmd ftp://*,rcp://*,scp://*,http://*,file://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau FileWritePre ".fnameescape(expand(""))|exe "'[,']".'Nwrite '.fnameescape(expand(""))|exe "sil doau FileWritePost ".fnameescape(expand("")) - try + try au SourceCmd ftp://*,rcp://*,scp://*,http://*,file://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe 'Nsource '.fnameescape(expand("")) - catch /^Vim\%((\a\+)\)\=:E216/ + catch /^Vim\%((\a\+)\)\=:E216/ au SourcePre ftp://*,rcp://*,scp://*,http://*,file://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe 'Nsource '.fnameescape(expand("")) endtry augroup END @@ -81,7 +81,7 @@ if !exists("g:netrw_nogx") if !hasmapto('NetrwBrowseX') nmap gx NetrwBrowseX endif - nno NetrwBrowseX :call netrw#BrowseX(netrw#GX(),netrw#CheckIfRemote(netrw#GX())) + nno NetrwBrowseX :call netrw#BrowseX(expand((exists("g:netrw_gx")? g:netrw_gx : '')),netrw#CheckIfRemote()) endif if maparg('gx','v') == "" if !hasmapto('NetrwBrowseXVis') @@ -103,7 +103,7 @@ fun! s:LocalBrowse(dirname) " Unfortunate interaction -- only DechoMsg debugging calls can be safely used here. " Otherwise, the BufEnter event gets triggered when attempts to write to " the DBG buffer are made. - + if !exists("s:vimentered") " If s:vimentered doesn't exist, then the VimEnter event hasn't fired. It will, " and so s:VimEnter() will then be calling this routine, but this time with s:vimentered defined. -- cgit