Use nvim vim.ui.open as a fallback

Resolves: https://github.com/tpope/vim-fugitive/pull/2322
This commit is contained in:
Tim Pope
2024-07-18 19:24:26 -04:00
parent 8c8cdf4405
commit 0444df68cd

View File

@@ -7441,6 +7441,8 @@ function! s:BrowserOpen(url, mods, echo_copy) abort
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')
return 'echo '.string(url).'|' . mods . 'call netrw#NetrwBrowseX('.string(url).', 0)' return 'echo '.string(url).'|' . mods . 'call netrw#NetrwBrowseX('.string(url).', 0)'
elseif has('nvim-0.10')
return mods . 'echo luaeval("({vim.ui.open(_A)})[2] or _A", ' . string(url) . ')'
else else
return 'echoerr ' . string('Netrw not found. Define your own :Browse to use :GBrowse') return 'echoerr ' . string('Netrw not found. Define your own :Browse to use :GBrowse')
endif endif