Improve rejection of unsuitable buffers.

This commit is contained in:
Andy Stewart
2016-03-29 18:17:31 +01:00
parent 28353bd060
commit 78d83c7056

View File

@@ -26,17 +26,17 @@ endfunction
function! gitgutter#utility#is_active()
return g:gitgutter_enabled &&
\ !pumvisible() &&
\ gitgutter#utility#is_file_buffer() &&
\ gitgutter#utility#exists_file() &&
\ gitgutter#utility#not_git_dir() &&
\ !gitgutter#utility#help_file()
\ gitgutter#utility#not_git_dir()
endfunction
function! gitgutter#utility#not_git_dir()
return gitgutter#utility#full_path_to_directory_of_file() !~ '[/\\]\.git\($\|[/\\]\)'
endfunction
function! gitgutter#utility#help_file()
return getbufvar(s:bufnr, '&filetype') ==# 'help' && getbufvar(s:bufnr, '&buftype') ==# 'help'
function! gitgutter#utility#is_file_buffer()
return empty(getbufvar(s:bufnr, '&buftype'))
endfunction
" A replacement for the built-in `shellescape(arg)`.