Fix netrw gx in Fugitive buffers

This commit is contained in:
Tim Pope
2020-01-09 20:27:39 -05:00
parent 4074727343
commit 394c925381

View File

@@ -2079,6 +2079,12 @@ function! fugitive#BufReadCmd(...) abort
endtry
setlocal modifiable
let browsex = maparg('<Plug>NetrwBrowseX', 'n')
if browsex =~# 'netrw#CheckIfRemote()'
exe 'nnoremap <buffer> <Plug>NetrwBrowseX' substitute(browsex, '\Cnetrw#CheckIfRemote()', '0', 'g')
endif
return 'silent ' . s:DoAutocmd('BufReadPost') .
\ (modifiable ? '' : '|setl nomodifiable')
catch /^fugitive:/