From 9b50074e44b1b7c544b3c2cfee9b68ec0cbc9440 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Mon, 16 Jan 2023 22:04:11 -0500 Subject: [PATCH] Better error message when :GBrowse remote not found Resolves: https://github.com/tpope/vim-fugitive/issues/2103 --- autoload/fugitive.vim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 14ce653..c9b9e53 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -7524,7 +7524,11 @@ function! fugitive#BrowseCommand(line1, count, range, bang, mods, arg, ...) abor endif endfor - throw "fugitive: no GBrowse handler installed for '".raw."'" + if !empty(remote_url) + return 'echoerr ' . string("fugitive: no GBrowse handler installed for '".remote_url."'") + else + return 'echoerr ' . string("fugitive: could not find remote named '".remote."'") + endif catch /^fugitive:/ return 'echoerr ' . string(v:exception) endtry