motiejus/dotfiles

Unnamed repository; edit this file 'description' to name the repository.
git clone https://git.jakstys.lt/motiejus/dotfiles.git
Log | Tree | Refs | README | LICENSE

commit 6c44c4795e0cfcd8439a7d558d013f246b60d077 (tree)
parent 27e2212ac04b16d20fbdedfad8ff80be20a746ce
Author: Tim Pope <code@tpope.net>
Date:   Tue, 25 May 2010 16:48:34 -0400

Only :diffoff in 'diff' buffers

Diffstat:
Mplugin/fugitive.vim | 10++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)

diff --git 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('<abuf>'), 'git_dir') !=# '' | diffoff! | endif - autocmd BufWinEnter * if s:diff_window_count() == 1 && &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') !=# '' | 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)