mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-12 21:33:53 -05:00
Fix bug in realtime diff of non-current buffer.
This bug meant that a realtime diff of a buffer which wasn't the current one -- which happens during GitGutterAll() -- diffed the staged version of the buffer against the current buffer's contents instead of the buffer's contents.
This commit is contained in:
@@ -36,6 +36,17 @@ function! utility#save_last_seen_change(file)
|
||||
call setbufvar(a:file, 'gitgutter_last_tick', getbufvar(a:file, 'changedtick'))
|
||||
endfunction
|
||||
|
||||
function! utility#buffer_contents()
|
||||
if &fileformat ==# "dos"
|
||||
let eol = "\r\n"
|
||||
elseif &fileformat ==# "mac"
|
||||
let eol = "\r"
|
||||
else
|
||||
let eol = "\n"
|
||||
endif
|
||||
return join(getbufline(s:file, 1, '$'), eol) . eol
|
||||
endfunction
|
||||
|
||||
" https://github.com/tpope/vim-dispatch/blob/9cdd05a87f8a47120335be03dfcd8358544221cd/autoload/dispatch/windows.vim#L8-L17
|
||||
function! utility#escape(str)
|
||||
if &shellxquote ==# '"'
|
||||
|
||||
Reference in New Issue
Block a user