From d428032600f738ff5246576a92716779a2b9d5d7 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Wed, 15 Jan 2020 02:05:50 -0500 Subject: [PATCH] Fix netrw gx in Fugitive buffers AGAIN --- autoload/fugitive.vim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index d7542b4..c8838b7 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -2071,8 +2071,9 @@ function! fugitive#BufReadCmd(...) abort setlocal modifiable let browsex = maparg('NetrwBrowseX', 'n') - if browsex =~# 'netrw#CheckIfRemote()' - exe 'nnoremap NetrwBrowseX' substitute(browsex, '\Cnetrw#CheckIfRemote()', '0', 'g') + let remote_check = '\Cnetrw#CheckIfRemote(\%(netrw#GX()\)\=)' + if browsex =~# remote_check + exe 'nnoremap NetrwBrowseX' substitute(browsex, remote_check, '0', 'g') endif return 'silent ' . s:DoAutocmd('BufReadPost') .