mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-08 11:33:48 -05:00
Improve rejection of unsuitable buffers.
This commit is contained in:
@@ -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)`.
|
||||
|
||||
Reference in New Issue
Block a user