From 9ea1f43a6a2b3e94f9c3a6919847e0ed26ae3ee3 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Fri, 17 Jun 2022 23:17:14 -0400 Subject: [PATCH] Delete temp files created computing :GBrowse line numbers --- autoload/fugitive.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index eef76cf..cb9ef05 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -7380,13 +7380,15 @@ function! fugitive#BrowseCommand(line1, count, range, bang, mods, arg, ...) abor let blame_in = tempname() silent exe 'noautocmd keepalt %write' blame_in let [blame, exec_error] = s:LinesError(['-c', 'blame.coloring=none', 'blame', '--contents', blame_in, '-L', line1.','.line2, '-S', blame_list, '-s', '--show-number', './' . path], dir) + call delete(blame_in) + call delete(blame_list) if !exec_error let blame_regex = '^\^\x\+\s\+\zs\d\+\ze\s' if get(blame, 0) =~# blame_regex && get(blame, -1) =~# blame_regex let line1 = +matchstr(blame[0], blame_regex) let line2 = +matchstr(blame[-1], blame_regex) else - throw "fugitive: can't browse to uncommitted change" + throw "fugitive: can't browse to unpushed change" endif endif endif