mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-09 12:03:48 -05:00
@@ -30,7 +30,7 @@ function! gitgutter#diff#run_diff(realtime, use_external_grep)
|
|||||||
let buff_file .= '.'.extension
|
let buff_file .= '.'.extension
|
||||||
endif
|
endif
|
||||||
let cmd .= 'git show '.blob_name.' > '.blob_file.' && '
|
let cmd .= 'git show '.blob_name.' > '.blob_file.' && '
|
||||||
execute 'silent write' buff_file
|
execute 'keepalt silent write' buff_file
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let cmd .= 'git diff --no-ext-diff --no-color -U0 '.g:gitgutter_diff_args.' -- '
|
let cmd .= 'git diff --no-ext-diff --no-color -U0 '.g:gitgutter_diff_args.' -- '
|
||||||
|
|||||||
@@ -20,3 +20,8 @@ function! DumpGitDiffStaged(filename)
|
|||||||
call system('git diff --staged fixture.txt > '.a:filename.'.actual')
|
call system('git diff --staged fixture.txt > '.a:filename.'.actual')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! Dump(text, filename)
|
||||||
|
let msg = type(a:text) == 1 ? split(a:text, '\n') : a:text
|
||||||
|
call writefile(msg, a:filename.'.actual', 'a')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|||||||
3
test/keepAlt.expected
Normal file
3
test/keepAlt.expected
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
buffer: fixture.txt
|
||||||
|
altbuffer:
|
||||||
|
altbuffer:
|
||||||
12
test/testKeepAlt.vim
Normal file
12
test/testKeepAlt.vim
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
source helper.vim
|
||||||
|
call Setup()
|
||||||
|
|
||||||
|
enew
|
||||||
|
execute "normal! \<C-^>"
|
||||||
|
call Dump('buffer: '.bufname(''), 'keepAlt')
|
||||||
|
call Dump('altbuffer: '.bufname('#'), 'keepAlt')
|
||||||
|
|
||||||
|
normal ggx
|
||||||
|
doautocmd CursorHold
|
||||||
|
call Dump('altbuffer: '.bufname('#'), 'keepAlt')
|
||||||
|
|
||||||
Reference in New Issue
Block a user