diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index 5de9c88..3bcab0a 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -1000,8 +1000,8 @@ call s:command("-bang -bar -nargs=? -complete=customlist,s:EditComplete Gdiff :e augroup fugitive_diff autocmd! - autocmd BufWinLeave * if s:diff_window_count() == 2 && &diff && getbufvar(+expand(''), 'git_dir') !=# '' | diffoff! | endif - autocmd BufWinEnter * if s:diff_window_count() == 1 && &diff && getbufvar(+expand(''), 'git_dir') !=# '' | diffoff | endif + autocmd BufWinLeave * if s:diff_window_count() == 2 && &diff && getbufvar(+expand(''), 'git_dir') !=# '' | windo call s:diff_off() | endif + autocmd BufWinEnter * if s:diff_window_count() == 1 && &diff && getbufvar(+expand(''), 'git_dir') !=# '' | call s:diff_off() | endif augroup END function! s:diff_window_count() @@ -1012,6 +1012,12 @@ function! s:diff_window_count() return c endfunction +function! s:diff_off() + if &l:diff + diffoff + endif +endfunction + function! s:buffer_compare_age(commit) dict abort let scores = {':0': 1, ':1': 2, ':2': 3, ':': 4, ':3': 5} let my_score = get(scores,':'.self.commit(),0)