Fixed caching error in git_history

This commit is contained in:
Talia 2018-04-12 14:18:29 +02:00
parent 9aed3c09c9
commit 3fbf78a105

4
vimrc
View file

@ -301,7 +301,7 @@ command! -nargs=* Hex call <sid>hex(<q-args>)
function! s:git_history() function! s:git_history()
if exists("b:git_history") if exists("b:git_history")
if b:git_history[0]+10 < localtime() if b:git_history[0]+10 > localtime()
return b:git_history[1] return b:git_history[1]
end end
end end
@ -309,7 +309,7 @@ function! s:git_history()
if exists("b:git_original_file") " Is this already a file@revision buffer? if exists("b:git_original_file") " Is this already a file@revision buffer?
let l:fname = b:git_original_file let l:fname = b:git_original_file
else else
let l:fname = expand("%") let l:fname = substitute(expand("%"), "\\\\", "/", "g")
end end
let l:commits = system('git log --format="%h" '.l:fname) let l:commits = system('git log --format="%h" '.l:fname)
let l:hist = split(l:commits, "\n") let l:hist = split(l:commits, "\n")