Fix GBrowse for newer Netrw versions

In vim/vim@ef92555 the arity of `netrw#BrowseX` changed from 2 to 1.
There is now a `netrw#os#Open()` function that can be used to open URLs
instead.
This commit is contained in:
Josh Priddle
2025-07-11 14:49:52 -04:00
committed by Tim Pope
parent 593f831d6f
commit d3e2b58dec

View File

@@ -7437,9 +7437,12 @@ function! s:BrowserOpen(url, mods, echo_copy) abort
else else
if !exists('g:loaded_netrw') if !exists('g:loaded_netrw')
runtime! autoload/netrw.vim runtime! autoload/netrw.vim
runtime! autoload/netrw/os.vim
endif endif
if exists('*netrw#Open') if exists('*netrw#Open')
return 'echo '.string(url).'|' . mods . 'call netrw#Open('.string(url).')' return 'echo '.string(url).'|' . mods . 'call netrw#Open('.string(url).')'
elseif exists('*netrw#os#Open')
return 'echo '.string(url).'|' . mods . 'call netrw#os#Open('.string(url).')'
elseif exists('*netrw#BrowseX') elseif exists('*netrw#BrowseX')
return 'echo '.string(url).'|' . mods . 'call netrw#BrowseX('.string(url).', 0)' return 'echo '.string(url).'|' . mods . 'call netrw#BrowseX('.string(url).', 0)'
elseif exists('*netrw#NetrwBrowseX') elseif exists('*netrw#NetrwBrowseX')