mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-08 11:33:48 -05:00
@@ -289,6 +289,9 @@ endfunction
|
||||
|
||||
|
||||
function! s:write_buffer(bufnr, file)
|
||||
let _write = &write
|
||||
set write
|
||||
|
||||
" Write specified buffer (which may not be the current buffer) to buff_file.
|
||||
" There doesn't seem to be a clean way to write a buffer that isn't the current
|
||||
" to a file; we have to switch to it, write it, then switch back.
|
||||
@@ -309,6 +312,8 @@ function! s:write_buffer(bufnr, file)
|
||||
call setpos("']", op_mark_end)
|
||||
|
||||
execute 'noautocmd buffer' current_buffer
|
||||
|
||||
let &write = _write
|
||||
endfunction
|
||||
|
||||
|
||||
|
||||
@@ -424,3 +424,16 @@ function Test_undo_nearby_hunk()
|
||||
call assert_equal(expected, s:git_diff())
|
||||
|
||||
endfunction
|
||||
|
||||
|
||||
function Test_write_option()
|
||||
set nowrite
|
||||
|
||||
normal ggo*
|
||||
doautocmd CursorHold
|
||||
|
||||
let expected = ["line=2 id=3000 name=GitGutterLineAdded"]
|
||||
call assert_equal(expected, s:signs('fixture.txt'))
|
||||
|
||||
set write
|
||||
endfunction
|
||||
|
||||
Reference in New Issue
Block a user