mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-11 21:03:53 -05:00
Only :diffoff in 'diff' buffers
This commit is contained in:
@@ -1000,8 +1000,8 @@ call s:command("-bang -bar -nargs=? -complete=customlist,s:EditComplete Gdiff :e
|
|||||||
|
|
||||||
augroup fugitive_diff
|
augroup fugitive_diff
|
||||||
autocmd!
|
autocmd!
|
||||||
autocmd BufWinLeave * if s:diff_window_count() == 2 && &diff && getbufvar(+expand('<abuf>'), 'git_dir') !=# '' | diffoff! | endif
|
autocmd BufWinLeave * if s:diff_window_count() == 2 && &diff && getbufvar(+expand('<abuf>'), 'git_dir') !=# '' | windo call s:diff_off() | endif
|
||||||
autocmd BufWinEnter * if s:diff_window_count() == 1 && &diff && getbufvar(+expand('<abuf>'), 'git_dir') !=# '' | diffoff | endif
|
autocmd BufWinEnter * if s:diff_window_count() == 1 && &diff && getbufvar(+expand('<abuf>'), 'git_dir') !=# '' | call s:diff_off() | endif
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
function! s:diff_window_count()
|
function! s:diff_window_count()
|
||||||
@@ -1012,6 +1012,12 @@ function! s:diff_window_count()
|
|||||||
return c
|
return c
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! s:diff_off()
|
||||||
|
if &l:diff
|
||||||
|
diffoff
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! s:buffer_compare_age(commit) dict abort
|
function! s:buffer_compare_age(commit) dict abort
|
||||||
let scores = {':0': 1, ':1': 2, ':2': 3, ':': 4, ':3': 5}
|
let scores = {':0': 1, ':1': 2, ':2': 3, ':': 4, ':3': 5}
|
||||||
let my_score = get(scores,':'.self.commit(),0)
|
let my_score = get(scores,':'.self.commit(),0)
|
||||||
|
|||||||
Reference in New Issue
Block a user