|
1 | 1 | " Vim completion script |
2 | 2 | " Language: All languages, uses existing syntax highlighting rules |
3 | 3 | " Maintainer: David Fishburn <dfishburn dot vim at gmail dot com> |
4 | | -" Version: 7.0 |
5 | | -" Last Change: 2010 Jul 29 |
| 4 | +" Version: 8.0 |
| 5 | +" Last Change: 2011 Nov 02 |
6 | 6 | " Usage: For detailed help, ":help ft-syntax-omni" |
7 | 7 |
|
8 | 8 | " History |
9 | 9 | " |
| 10 | +" Version 8.0 |
| 11 | +" Updated SyntaxCSyntaxGroupItems() |
| 12 | +" - Some additional syntax items were also allowed |
| 13 | +" on nextgroup= lines which were ignored by default. |
| 14 | +" Now these lines are processed independently. |
| 15 | +" |
10 | 16 | " Version 7.0 |
11 | 17 | " Updated syntaxcomplete#OmniSyntaxList() |
12 | 18 | " - Looking up the syntax groups defined from a syntax file |
|
44 | 50 | if exists('g:loaded_syntax_completion') |
45 | 51 | finish |
46 | 52 | endif |
47 | | -let g:loaded_syntax_completion = 70 |
| 53 | +let g:loaded_syntax_completion = 80 |
48 | 54 |
|
49 | 55 | " Set ignorecase to the ftplugin standard |
50 | 56 | " This is the default setting, but if you define a buffer local |
|
72 | 78 | " This script will build a completion list based on the syntax |
73 | 79 | " elements defined by the files in $VIMRUNTIME/syntax. |
74 | 80 | let s:syn_remove_words = 'match,matchgroup=,contains,'. |
75 | | - \ 'links to,start=,end=,nextgroup=' |
| 81 | + \ 'links to,start=,end=' |
| 82 | + " \ 'links to,start=,end=,nextgroup=' |
76 | 83 |
|
77 | 84 | let s:cache_name = [] |
78 | 85 | let s:cache_list = [] |
@@ -411,9 +418,25 @@ function! s:SyntaxCSyntaxGroupItems( group_name, syntax_full ) |
411 | 418 | \ , "\n", 'g' |
412 | 419 | \ ) |
413 | 420 |
|
414 | | - " Now strip off the newline + blank space + contained |
| 421 | + " Now strip off the newline + blank space + contained. |
| 422 | + " Also include lines with nextgroup=@someName skip_key_words syntax_element |
| 423 | + let syn_list = substitute( |
| 424 | + \ syn_list, '\%(^\|\n\)\@<=\s*\<\(contained\|nextgroup=\)' |
| 425 | + \ , "", 'g' |
| 426 | + \ ) |
| 427 | + |
| 428 | + " This can leave lines like this |
| 429 | + " =@vimMenuList skipwhite onoremenu |
| 430 | + " Strip the special option keywords first |
| 431 | + " :h :syn-skipwhite* |
| 432 | + let syn_list = substitute( |
| 433 | + \ syn_list, '\<\(skipwhite\|skipnl\|skipempty\)\>' |
| 434 | + \ , "", 'g' |
| 435 | + \ ) |
| 436 | + |
| 437 | + " Now remove the remainder of the nextgroup=@someName lines |
415 | 438 | let syn_list = substitute( |
416 | | - \ syn_list, '\%(^\|\n\)\@<=\s*\<\(contained\)' |
| 439 | + \ syn_list, '\%(^\|\n\)\@<=\s*\(@\w\+\)' |
417 | 440 | \ , "", 'g' |
418 | 441 | \ ) |
419 | 442 |
|
|
0 commit comments