Don't treat buftype=nofile buffer names as file names

Resolves: https://github.com/tpope/vim-fugitive/issues/1905
This commit is contained in:
Tim Pope
2021-12-08 16:07:29 -05:00
parent c04e80c6eb
commit 365231384c

View File

@@ -7221,7 +7221,7 @@ function! fugitive#BrowseCommand(line1, count, range, bang, mods, arg, ...) abor
endif endif
exe s:DirCheck(dir) exe s:DirCheck(dir)
if empty(expanded) if empty(expanded)
let bufname = s:BufName('%') let bufname = &buftype =~# '^\%(nofile\|terminal\)$' ? '' : s:BufName('%')
let expanded = s:DirRev(bufname)[1] let expanded = s:DirRev(bufname)[1]
if empty(expanded) if empty(expanded)
let expanded = fugitive#Path(bufname, ':(top)', dir) let expanded = fugitive#Path(bufname, ':(top)', dir)