mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-08 19:43:47 -05:00
Improve rejection of unsuitable buffers.
This commit is contained in:
@@ -26,17 +26,17 @@ endfunction
|
|||||||
function! gitgutter#utility#is_active()
|
function! gitgutter#utility#is_active()
|
||||||
return g:gitgutter_enabled &&
|
return g:gitgutter_enabled &&
|
||||||
\ !pumvisible() &&
|
\ !pumvisible() &&
|
||||||
|
\ gitgutter#utility#is_file_buffer() &&
|
||||||
\ gitgutter#utility#exists_file() &&
|
\ gitgutter#utility#exists_file() &&
|
||||||
\ gitgutter#utility#not_git_dir() &&
|
\ gitgutter#utility#not_git_dir()
|
||||||
\ !gitgutter#utility#help_file()
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! gitgutter#utility#not_git_dir()
|
function! gitgutter#utility#not_git_dir()
|
||||||
return gitgutter#utility#full_path_to_directory_of_file() !~ '[/\\]\.git\($\|[/\\]\)'
|
return gitgutter#utility#full_path_to_directory_of_file() !~ '[/\\]\.git\($\|[/\\]\)'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! gitgutter#utility#help_file()
|
function! gitgutter#utility#is_file_buffer()
|
||||||
return getbufvar(s:bufnr, '&filetype') ==# 'help' && getbufvar(s:bufnr, '&buftype') ==# 'help'
|
return empty(getbufvar(s:bufnr, '&buftype'))
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" A replacement for the built-in `shellescape(arg)`.
|
" A replacement for the built-in `shellescape(arg)`.
|
||||||
|
|||||||
Reference in New Issue
Block a user