Always prevent flicker.

Previously flicker was prevented only when the sign column was
always present.
This commit is contained in:
Andy Stewart
2013-04-10 10:34:16 +02:00
parent fe1a76901c
commit d4a1a60f39
2 changed files with 10 additions and 4 deletions

View File

@@ -199,10 +199,6 @@ Note that this is always off with gVim on Windows due to a Vim/shell bug causing
Your colorscheme is configuring the `SignColumn` highlight group weirdly. Please see the section above on customising the sign column.
> Why does the window flicker when the signs are redrawn?
This happens on certain combinations of OS and Vim. You can prevent the flicker by adding `let g:gitgutter_sign_column_always = 1` to your `~/.vimrc`.
> There's a noticeable lag when vim-gitter runs; how can I avoid it?
By default vim-gitgutter runs often so the signs are as accurate as possible. However on some systems this causes a noticeable lag. If you would like to trade a little accuracy for speed, add one or both of these to your `~/.vimrc`:

View File

@@ -110,6 +110,10 @@ function! s:is_tracked_by_git()
return !v:shell_error
endfunction
function! s:differences(hunks)
return len(a:hunks) != 0
endfunction
function! s:snake_case_to_camel_case(text)
return substitute(a:text, '\v(.)(\a+)(_(.)(.+))?', '\u\1\l\2\u\4\l\5', '')
endfunction
@@ -417,6 +421,12 @@ function! GitGutter(file)
let modified_lines = s:process_hunks(s:hunks)
if g:gitgutter_sign_column_always
call s:add_dummy_sign()
else
if s:differences(s:hunks)
call s:add_dummy_sign() " prevent flicker
else
call s:remove_dummy_sign()
endif
endif
call s:clear_signs(a:file)
call s:find_other_signs(a:file)