|
1 | 1 | " vim-tags - The Ctags generator for Vim
|
2 | 2 | " Maintainer: Szymon Wrozynski
|
3 |
| -" Version: 0.0.7 |
| 3 | +" Version: 0.0.8 |
4 | 4 | "
|
5 | 5 | " Installation:
|
6 | 6 | " Place in ~/.vim/plugin/tags.vim or in case of Pathogen:
|
@@ -73,11 +73,15 @@ command! -bang -nargs=0 TagsGenerate :call s:generate_tags(<bang>0, 1)
|
73 | 73 | let options = ['--tag-relative']
|
74 | 74 | let s:custom_dirs = []
|
75 | 75 |
|
76 |
| -" Exclude ignored files and directories |
| 76 | +let s:files_to_include = [] |
| 77 | + |
| 78 | +" Exclude ignored files and directories (also handle negated patterns (!)) |
77 | 79 | for ignore_file in g:vim_tags_ignore_files
|
78 | 80 | if filereadable(ignore_file)
|
79 | 81 | for line in readfile(ignore_file)
|
80 |
| - if strlen(line) > 1 && match(line, g:vim_tags_ignore_file_comment_pattern) == -1 |
| 82 | + if match(line, '^!') != -1 |
| 83 | + call add(s:files_to_include, substitute(substitute(line, '^!', '', ''), '^/', '', '')) |
| 84 | + elseif strlen(line) > 1 && match(line, g:vim_tags_ignore_file_comment_pattern) == -1 |
81 | 85 | call add(options, '--exclude=' . shellescape(substitute(line, '^/', '', '')))
|
82 | 86 | endif
|
83 | 87 | endfor
|
@@ -146,6 +150,14 @@ fun! s:generate_tags(bang, redraw)
|
146 | 150 | let project_tags_command = substitute(project_tags_command, '{DIRECTORY}', '.', '')
|
147 | 151 | call s:execute_async_command(project_tags_command)
|
148 | 152 |
|
| 153 | + " Append files from negated patterns |
| 154 | + if !empty(s:files_to_include) |
| 155 | + let append_command_template = substitute(g:vim_tags_project_tags_command, '{OPTIONS}', '--tag-relative -a -f ' . s:tags_directory . '/' . g:vim_tags_main_file, '') |
| 156 | + for file_to_include in s:files_to_include |
| 157 | + call s:execute_async_command(substitute(append_command_template, '{DIRECTORY}', file_to_include, '')) |
| 158 | + endfor |
| 159 | + endif |
| 160 | + |
149 | 161 | "Gemfile.lock
|
150 | 162 | let gemfile_time = getftime('Gemfile.lock')
|
151 | 163 | if gemfile_time > -1
|
|
0 commit comments