mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-14 14:23:51 -05:00
Delete temp files created computing :GBrowse line numbers
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user