From 365231384cf9edc32b2fc34f6c3e1b31eeabfedf Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Wed, 8 Dec 2021 16:07:29 -0500 Subject: [PATCH] Don't treat buftype=nofile buffer names as file names Resolves: https://github.com/tpope/vim-fugitive/issues/1905 --- autoload/fugitive.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index bcc85aa..192c3f2 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -7221,7 +7221,7 @@ function! fugitive#BrowseCommand(line1, count, range, bang, mods, arg, ...) abor endif exe s:DirCheck(dir) if empty(expanded) - let bufname = s:BufName('%') + let bufname = &buftype =~# '^\%(nofile\|terminal\)$' ? '' : s:BufName('%') let expanded = s:DirRev(bufname)[1] if empty(expanded) let expanded = fugitive#Path(bufname, ':(top)', dir)