mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-09 12:03:48 -05:00
Prevent infinite loop on Windows gVim.
This commit is contained in:
committed by
Andy Stewart
parent
6889f9918e
commit
a09e085b51
@@ -12,6 +12,10 @@ endif
|
|||||||
if !exists('g:gitgutter_highlight_lines')
|
if !exists('g:gitgutter_highlight_lines')
|
||||||
let g:gitgutter_highlight_lines = 0
|
let g:gitgutter_highlight_lines = 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if !exists('g:gitgutter_force_focusgained')
|
||||||
|
let g:gitgutter_force_focusgained = 0
|
||||||
|
endif
|
||||||
let s:highlight_lines = g:gitgutter_highlight_lines
|
let s:highlight_lines = g:gitgutter_highlight_lines
|
||||||
|
|
||||||
function! s:init()
|
function! s:init()
|
||||||
@@ -284,6 +288,10 @@ function! s:process_modified_and_removed(modifications, from_count, to_count, to
|
|||||||
call add(a:modifications, [a:to_line + offset - 1, 'modified_removed'])
|
call add(a:modifications, [a:to_line + offset - 1, 'modified_removed'])
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
function! s:is_gvim_on_windows()
|
||||||
|
return has("gui_running") && (has("win16") || has("win32") || has("win64"))
|
||||||
|
endfunction
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
" Sign processing {{{
|
" Sign processing {{{
|
||||||
@@ -464,7 +472,10 @@ endfunction
|
|||||||
|
|
||||||
augroup gitgutter
|
augroup gitgutter
|
||||||
autocmd!
|
autocmd!
|
||||||
autocmd BufReadPost,BufWritePost,FileReadPost,FileWritePost,FocusGained * call GitGutter()
|
autocmd BufReadPost,BufWritePost,FileReadPost,FileWritePost * call GitGutter()
|
||||||
|
if !s:is_gvim_on_windows() || g:gitgutter_force_focusgained
|
||||||
|
autocmd FocusGained * call GitGutter()
|
||||||
|
endif
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
" }}}
|
" }}}
|
||||||
|
|||||||
Reference in New Issue
Block a user