From 81074db0ee7d2c9aa6f2a4cb6f38040e3fb22ff5 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Sat, 3 Apr 2021 21:23:09 -0400 Subject: [PATCH] Pass along to URL opener I don't know if there is a use for this, but it seems like the right thing to do. --- autoload/fugitive.vim | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index ccb681f..72e329c 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -6260,23 +6260,24 @@ function! fugitive#BrowseCommand(line1, count, range, bang, mods, arg, args) abo endif let url = substitute(url, '[ <>\|"]', '\="%".printf("%02X",char2nr(submatch(0)))', 'g') + let mods = s:Mods(a:mods) if a:bang if has('clipboard') let @+ = url endif return 'echo '.string(url) elseif exists(':Browse') == 2 - return 'echo '.string(url).'|Browse '.url + return 'echo '.string(url).'|' . mods . 'Browse '.url elseif exists(':OpenBrowser') == 2 - return 'echo '.string(url).'|OpenBrowser '.url + return 'echo '.string(url).'|' . mods . 'OpenBrowser '.url else if !exists('g:loaded_netrw') runtime! autoload/netrw.vim endif if exists('*netrw#BrowseX') - return 'echo '.string(url).'|call netrw#BrowseX('.string(url).', 0)' + return 'echo '.string(url).'|' . mods . 'call netrw#BrowseX('.string(url).', 0)' elseif exists('*netrw#NetrwBrowseX') - return 'echo '.string(url).'|call netrw#NetrwBrowseX('.string(url).', 0)' + return 'echo '.string(url).'|' . mods . 'call netrw#NetrwBrowseX('.string(url).', 0)' else return 'echoerr ' . string('Netrw not found. Define your own :Browse to use :GBrowse') endif