Skip to content

Add whitelist feature #160

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions autoload/xolox/easytags.vim
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,10 @@ function! xolox#easytags#autoload(event) " {{{2
endfunction

function! xolox#easytags#update(silent, filter_tags, filenames) " {{{2
if xolox#easytags#update#pass_whitelist() != 1
return 0
endif

let async = xolox#misc#option#get('easytags_async', 0)
call g:xolox#easytags#update_timer.start()
try
Expand Down
16 changes: 16 additions & 0 deletions autoload/xolox/easytags/update.vim
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,22 @@ function! xolox#easytags#update#foldcase_compare(a, b) " {{{1
return a == b ? 0 : a ># b ? 1 : -1
endfunction

function! xolox#easytags#update#pass_whitelist() " {{{1
if !exists('g:easytags_whitelist') || empty(g:easytags_whitelist)
return 1
endif

let current_dir = getcwd()
for white_reg in g:easytags_whitelist
call xolox#misc#msg#debug("easytags.vim %s: Test '%s' with '%s'.", g:xolox#easytags#version, current_dir, white_reg)
if match(current_dir, white_reg) != -1
return 1
endif
endfor

return 0
endfunction "}}}

function! s:create_cache() " {{{1
let cache = {'canonicalize_cache': {}, 'exists_cache': {}}
function cache.canonicalize(pathname) dict
Expand Down