mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-15 14:53:51 -05:00
Disable diff more more aggressively
This commit is contained in:
@@ -999,10 +999,18 @@ endfunction
|
||||
call s:command("-bang -bar -nargs=? -complete=customlist,s:EditComplete Gdiff :execute s:Diff(<bang>0,<f-args>)")
|
||||
|
||||
augroup fugitive_diff
|
||||
autocmd BufWinLeave * if winnr('$') == 2 && &diff && getbufvar(+expand('<abuf>'), 'git_dir') !=# '' | diffoff! | endif
|
||||
autocmd BufWinEnter * if winnr('$') == 1 && &diff && getbufvar(+expand('<abuf>'), 'git_dir') !=# '' | diffoff | endif
|
||||
autocmd BufWinLeave * if s:diff_window_count() == 2 && &diff && getbufvar(+expand('<abuf>'), 'git_dir') !=# '' | diffoff! | endif
|
||||
autocmd BufWinEnter * if s:diff_window_count() == 1 && &diff && getbufvar(+expand('<abuf>'), 'git_dir') !=# '' | diffoff | endif
|
||||
augroup END
|
||||
|
||||
function! s:diff_window_count()
|
||||
let c = 0
|
||||
for nr in range(1,winnr('$'))
|
||||
let c += getwinvar(nr,'&diff')
|
||||
endfor
|
||||
return c
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user