|
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.1' |
| 6 | +let g:xolox#easytags#version = '3.6.2' |
7 | 7 |
|
8 | 8 | " Plug-in initialization. {{{1
|
9 | 9 |
|
@@ -375,10 +375,33 @@ endfunction
|
375 | 375 | function! s:is_keyword_compatible(tag)
|
376 | 376 | let name = get(a:tag, 'name', '')
|
377 | 377 | if !empty(name)
|
378 |
| - return name =~ '^\k\+$' && len(name) <= 80 |
| 378 | + " Make sure the tag contains only `keyword characters' (included in the |
| 379 | + " &iskeyword option) and is not longer than 80 characters (these |
| 380 | + " limitations are documented under :help :syn-keyword). |
| 381 | + if name =~ '^\k\+$' && len(name) <= 80 |
| 382 | + " Make sure the tag doesn't conflict with one of the named options |
| 383 | + " accepted by the `:syntax keyword' command (using these named options |
| 384 | + " improperly, e.g. without a mandatory argument, will raise an error). |
| 385 | + return !has_key(s:invalid_keywords, name) |
379 | 386 | endif
|
| 387 | + return 0 |
380 | 388 | endfunction
|
381 | 389 |
|
| 390 | +" These are documented under :help E395, except for "contains" which is not |
| 391 | +" documented as being forbidden but when used definitely triggers an error. |
| 392 | +let s:invalid_keywords = { |
| 393 | + \ 'cchar': 1, |
| 394 | + \ 'conceal': 1, |
| 395 | + \ 'contained': 1, |
| 396 | + \ 'containedin': 1, |
| 397 | + \ 'contains': 1, |
| 398 | + \ 'nextgroup': 1, |
| 399 | + \ 'skipempty': 1, |
| 400 | + \ 'skipnl': 1, |
| 401 | + \ 'skipwhite': 1, |
| 402 | + \ 'transparent': 1, |
| 403 | + \ } |
| 404 | + |
382 | 405 | " Public supporting functions (might be useful to others). {{{1
|
383 | 406 |
|
384 | 407 | function! xolox#easytags#get_tagsfile() " {{{2
|
|
0 commit comments