|
3 | 3 | " Last Change: July 9, 2014 |
4 | 4 | " URL: http://peterodding.com/code/vim/easytags/ |
5 | 5 |
|
6 | | -let g:xolox#easytags#version = '3.6.2' |
| 6 | +let g:xolox#easytags#version = '3.6.3' |
| 7 | +let g:xolox#easytags#default_pattern_prefix = '\C\<' |
| 8 | +let g:xolox#easytags#default_pattern_suffix = '\>' |
7 | 9 |
|
8 | 10 | " Plug-in initialization. {{{1 |
9 | 11 |
|
@@ -314,8 +316,10 @@ function! xolox#easytags#highlight() " {{{2 |
314 | 316 | if matches != [] |
315 | 317 | " Convert matched tags to :syntax commands and execute them. |
316 | 318 | let use_keywords_when = xolox#misc#option#get('easytags_syntax_keyword', 'auto') |
317 | | - let tagkind_has_patterns = !(empty(tagkind.pattern_prefix) && empty(tagkind.pattern_suffix)) |
318 | | - if use_keywords_when == 'always' || (use_keywords_when == 'auto' && !tagkind_has_patterns) |
| 319 | + let has_default_pattern_prefix = (tagkind.pattern_prefix == g:xolox#easytags#default_pattern_prefix) |
| 320 | + let has_default_pattern_suffix = (tagkind.pattern_suffix == g:xolox#easytags#default_pattern_suffix) |
| 321 | + let has_non_default_patterns = !(has_default_pattern_prefix && has_default_pattern_suffix) |
| 322 | + if use_keywords_when == 'always' || (use_keywords_when == 'auto' && !has_non_default_patterns) |
319 | 323 | " Vim's ":syntax keyword" command doesn't use the regular |
320 | 324 | " expression engine and the resulting syntax highlighting is |
321 | 325 | " therefor much faster. Because of this we use the syntax |
@@ -490,10 +494,10 @@ endfunction |
490 | 494 |
|
491 | 495 | function! xolox#easytags#define_tagkind(object) " {{{2 |
492 | 496 | if !has_key(a:object, 'pattern_prefix') |
493 | | - let a:object.pattern_prefix = '' |
| 497 | + let a:object.pattern_prefix = g:xolox#easytags#default_pattern_prefix |
494 | 498 | endif |
495 | 499 | if !has_key(a:object, 'pattern_suffix') |
496 | | - let a:object.pattern_suffix = '' |
| 500 | + let a:object.pattern_suffix = g:xolox#easytags#default_pattern_suffix |
497 | 501 | endif |
498 | 502 | if !has_key(s:tagkinds, a:object.filetype) |
499 | 503 | let s:tagkinds[a:object.filetype] = [] |
|
0 commit comments