From 1067294cdc379be1deb56074a093b49a8303308f Mon Sep 17 00:00:00 2001 From: somini Date: Tue, 25 Aug 2015 23:43:11 +0100 Subject: [PATCH] Specify help files correctly This makes so that editing helpfiles directly triggers the gutters, while keeping the default behaviour of editing help buffers (opened with `:help stuff`) doesn't. --- autoload/gitgutter/utility.vim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/autoload/gitgutter/utility.vim b/autoload/gitgutter/utility.vim index 9f03eed..aabe99c 100644 --- a/autoload/gitgutter/utility.vim +++ b/autoload/gitgutter/utility.vim @@ -13,15 +13,15 @@ endfunction " Returns truthy when the buffer's file should be processed; and falsey when it shouldn't. " This function does not and should not make any system calls. function! gitgutter#utility#is_active() - return g:gitgutter_enabled && gitgutter#utility#exists_file() && gitgutter#utility#not_git_dir() && gitgutter#utility#not_help_file() + return g:gitgutter_enabled && gitgutter#utility#exists_file() && gitgutter#utility#not_git_dir() && !gitgutter#utility#help_file() endfunction function! gitgutter#utility#not_git_dir() return gitgutter#utility#full_path_to_directory_of_file() !~ '[/\\]\.git\($\|[/\\]\)' endfunction -function! gitgutter#utility#not_help_file() - return getbufvar(s:bufnr, '&filetype') != 'help' +function! gitgutter#utility#help_file() + return getbufvar(s:bufnr, '&filetype') ==# 'help' && getbufvar(s:bufnr, '&buftype') ==# 'help' endfunction " A replacement for the built-in `shellescape(arg)`.