From c13e0e1afd4b1d3dedfdaa6313e0d07bb16827fa Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Sat, 31 Aug 2019 22:22:50 -0400 Subject: [PATCH] Don't browse to blob for empty buffer --- autoload/fugitive.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 066c372..19c1402 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -5182,10 +5182,10 @@ function! s:BrowseCommand(line1, line2, range, count, bang, mods, reg, arg, args let path = '.git/' . full[strlen(dir)+1:-1] let type = '' else - let path = full[strlen(s:Tree(dir))+1:-1] + let path = fugitive#Path(full, '/')[1:-1] if path =~# '^\.git/' let type = '' - elseif isdirectory(full) + elseif isdirectory(full) || empty(path) let type = 'tree' else let type = 'blob'