mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-09 03:53:47 -05:00
Ensure that all buffers are processed at startup.
When opening vim with multiple files, e.g. via `vim -o file1 file2`, Vim fires a `BufEnter` event for each file. However the effective buffer number (`<abuf>`) is always 1, instead of being each buffer's number in turn, so we end up processing the first buffer n times instead of each of n buffers once. This commit is a brute force workaround to ensure all buffers are processed if there is more than one. Closes #428.
This commit is contained in:
@@ -208,6 +208,11 @@ augroup gitgutter
|
|||||||
|
|
||||||
autocmd TabEnter * call settabvar(tabpagenr(), 'gitgutter_didtabenter', 1)
|
autocmd TabEnter * call settabvar(tabpagenr(), 'gitgutter_didtabenter', 1)
|
||||||
|
|
||||||
|
" Ensure that all buffers are processed when opening vim with multiple files, e.g.:
|
||||||
|
"
|
||||||
|
" vim -o file1 file2
|
||||||
|
autocmd VimEnter * if winnr() != winnr('$') | :GitGutterAll | endif
|
||||||
|
|
||||||
if !has('gui_win32')
|
if !has('gui_win32')
|
||||||
autocmd FocusGained * call gitgutter#all()
|
autocmd FocusGained * call gitgutter#all()
|
||||||
endif
|
endif
|
||||||
|
|||||||
Reference in New Issue
Block a user