annotate runtime/autoload/syntaxcomplete.vim @ 23429:de278e062eb6

Added tag v8.2.2257 for changeset 5807e3958e3898e21dced2fae52a15c9aa00ef57
author Bram Moolenaar <Bram@vim.org>
date Thu, 31 Dec 2020 21:30:04 +0100
parents f2c2f9126a82
children ef454a7f485d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
1 " Vim completion script
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
2 " Language: All languages, uses existing syntax highlighting rules
2072
4a1bcdd9ea55 Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1620
diff changeset
3 " Maintainer: David Fishburn <dfishburn dot vim at gmail dot com>
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
4 " Version: 13.0
17758
f2c2f9126a82 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 4437
diff changeset
5 " Last Change: 2019 Aug 08
3996
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
6 " Usage: For detailed help, ":help ft-syntax-omni"
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
7
2072
4a1bcdd9ea55 Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1620
diff changeset
8 " History
2434
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
9 "
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
10 " Version 13.0
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
11 " - Extended the option omni_syntax_group_include_{filetype}
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
12 " to accept a comma separated list of regex's rather than
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
13 " string. For example, for the javascript filetype you could
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
14 " use:
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
15 " let g:omni_syntax_group_include_javascript = 'javascript\w\+,jquery\w\+'
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
16 " - Some syntax files (perl.vim) use the match // syntax as a mechanism
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
17 " to identify keywords. This update attempts to parse the
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
18 " match syntax and pull out syntax items which are at least
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
19 " 3 words or more.
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
20 "
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
21 " Version 12.0
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
22 " - It is possible to have '-' as part of iskeyword, when
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
23 " checking for character ranges, tighten up the regex.
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
24 " E688: More targets than List items.
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
25 "
3996
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
26 " Version 11.0
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
27 " - Corrected which characters required escaping during
3996
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
28 " substitution calls.
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
29 "
3920
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
30 " Version 10.0
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
31 " - Cycle through all the character ranges specified in the
3920
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
32 " iskeyword option and build a list of valid word separators.
3996
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
33 " Prior to this change, only actual characters were used,
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
34 " where for example ASCII "45" == "-". If "45" were used
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
35 " in iskeyword the hyphen would not be picked up.
3920
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
36 " This introduces a new option, since the character ranges
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
37 " specified could be multibyte:
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
38 " let g:omni_syntax_use_single_byte = 1
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
39 " - This by default will only allow single byte ASCII
3920
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
40 " characters to be added and an additional check to ensure
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
41 " the charater is printable (see documentation for isprint).
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
42 "
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
43 " Version 9.0
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
44 " - Add the check for cpo.
3920
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
45 "
3224
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2434
diff changeset
46 " Version 8.0
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
47 " - Updated SyntaxCSyntaxGroupItems()
3224
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2434
diff changeset
48 " - Some additional syntax items were also allowed
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2434
diff changeset
49 " on nextgroup= lines which were ignored by default.
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2434
diff changeset
50 " Now these lines are processed independently.
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2434
diff changeset
51 "
2434
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
52 " Version 7.0
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
53 " - Updated syntaxcomplete#OmniSyntaxList()
2434
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
54 " - Looking up the syntax groups defined from a syntax file
3996
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
55 " looked for only 1 format of {filetype}GroupName, but some
2434
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
56 " syntax writers use this format as well:
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
57 " {b:current_syntax}GroupName
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
58 " - OmniSyntaxList() will now check for both if the first
2434
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
59 " method does not find a match.
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
60 "
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
61 " Version 6.0
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
62 " - Added syntaxcomplete#OmniSyntaxList()
3996
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
63 " - Allows other plugins to use this for their own
2434
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
64 " purposes.
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
65 " - It will return a List of all syntax items for the
3996
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
66 " syntax group name passed in.
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
67 " - XPTemplate for SQL will use this function via the
2434
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
68 " sqlcomplete plugin to populate a Choose box.
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
69 "
2072
4a1bcdd9ea55 Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1620
diff changeset
70 " Version 5.0
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
71 " - Updated SyntaxCSyntaxGroupItems()
2434
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
72 " - When processing a list of syntax groups, the final group
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
73 " was missed in function SyntaxCSyntaxGroupItems.
2072
4a1bcdd9ea55 Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1620
diff changeset
74 "
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
75 " Set completion with CTRL-X CTRL-O to autoloaded function.
785
fd60bacf955b updated for version 7.0229
vimboss
parents: 702
diff changeset
76 " This check is in place in case this script is
3996
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
77 " sourced directly instead of using the autoload feature.
702
8a99b25de218 updated for version 7.0212
vimboss
parents: 625
diff changeset
78 if exists('+omnifunc')
785
fd60bacf955b updated for version 7.0229
vimboss
parents: 702
diff changeset
79 " Do not set the option if already set since this
fd60bacf955b updated for version 7.0229
vimboss
parents: 702
diff changeset
80 " results in an E117 warning.
fd60bacf955b updated for version 7.0229
vimboss
parents: 702
diff changeset
81 if &omnifunc == ""
fd60bacf955b updated for version 7.0229
vimboss
parents: 702
diff changeset
82 setlocal omnifunc=syntaxcomplete#Complete
fd60bacf955b updated for version 7.0229
vimboss
parents: 702
diff changeset
83 endif
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
84 endif
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
85
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
86 if exists('g:loaded_syntax_completion')
3996
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
87 finish
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
88 endif
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
89 let g:loaded_syntax_completion = 130
3920
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
90
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
91 " Turn on support for line continuations when creating the script
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
92 let s:cpo_save = &cpo
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
93 set cpo&vim
871
c301dba834d0 updated for version 7.0g05
vimboss
parents: 818
diff changeset
94
c301dba834d0 updated for version 7.0g05
vimboss
parents: 818
diff changeset
95 " Set ignorecase to the ftplugin standard
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
96 " This is the default setting, but if you define a buffer local
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
97 " variable you can override this on a per filetype.
871
c301dba834d0 updated for version 7.0g05
vimboss
parents: 818
diff changeset
98 if !exists('g:omni_syntax_ignorecase')
c301dba834d0 updated for version 7.0g05
vimboss
parents: 818
diff changeset
99 let g:omni_syntax_ignorecase = &ignorecase
c301dba834d0 updated for version 7.0g05
vimboss
parents: 818
diff changeset
100 endif
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
101
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
102 " Indicates whether we should use the iskeyword option to determine
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
103 " how to split words.
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
104 " This is the default setting, but if you define a buffer local
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
105 " variable you can override this on a per filetype.
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
106 if !exists('g:omni_syntax_use_iskeyword')
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
107 let g:omni_syntax_use_iskeyword = 1
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
108 endif
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
109
3920
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
110 " When using iskeyword, this setting controls whether the characters
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
111 " should be limited to single byte characters.
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
112 if !exists('g:omni_syntax_use_single_byte')
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
113 let g:omni_syntax_use_single_byte = 1
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
114 endif
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
115
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
116 " When using iskeyword, this setting controls whether the characters
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
117 " should be limited to single byte characters.
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
118 if !exists('g:omni_syntax_use_iskeyword_numeric')
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
119 let g:omni_syntax_use_iskeyword_numeric = 1
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
120 endif
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
121
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
122 " Only display items in the completion window that are at least
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
123 " this many characters in length.
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
124 " This is the default setting, but if you define a buffer local
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
125 " variable you can override this on a per filetype.
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
126 if !exists('g:omni_syntax_minimum_length')
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
127 let g:omni_syntax_minimum_length = 0
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
128 endif
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
129
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
130 " This script will build a completion list based on the syntax
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
131 " elements defined by the files in $VIMRUNTIME/syntax.
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
132 " let s:syn_remove_words = 'match,matchgroup=,contains,'.
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
133 let s:syn_remove_words = 'matchgroup=,contains,'.
3224
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2434
diff changeset
134 \ 'links to,start=,end='
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2434
diff changeset
135 " \ 'links to,start=,end=,nextgroup='
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
136
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
137 let s:cache_name = []
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
138 let s:cache_list = []
785
fd60bacf955b updated for version 7.0229
vimboss
parents: 702
diff changeset
139 let s:prepended = ''
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
140
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
141 " This function is used for the 'omnifunc' option.
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
142 function! syntaxcomplete#Complete(findstart, base)
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
143
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
144 " Only display items in the completion window that are at least
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
145 " this many characters in length
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
146 if !exists('b:omni_syntax_ignorecase')
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
147 if exists('g:omni_syntax_ignorecase')
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
148 let b:omni_syntax_ignorecase = g:omni_syntax_ignorecase
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
149 else
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
150 let b:omni_syntax_ignorecase = &ignorecase
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
151 endif
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
152 endif
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
153
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
154 if a:findstart
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
155 " Locate the start of the item, including "."
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
156 let line = getline('.')
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
157 let start = col('.') - 1
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
158 let lastword = -1
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
159 while start > 0
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
160 " if line[start - 1] =~ '\S'
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
161 " let start -= 1
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
162 " elseif line[start - 1] =~ '\.'
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
163 if line[start - 1] =~ '\k'
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
164 let start -= 1
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
165 let lastword = a:findstart
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
166 else
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
167 break
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
168 endif
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
169 endwhile
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
170
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
171 " Return the column of the last word, which is going to be changed.
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
172 " Remember the text that comes before it in s:prepended.
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
173 if lastword == -1
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
174 let s:prepended = ''
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
175 return start
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
176 endif
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
177 let s:prepended = strpart(line, start, (col('.') - 1) - start)
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
178 return start
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
179 endif
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
180
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
181 " let base = s:prepended . a:base
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
182 let base = s:prepended
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
183
871
c301dba834d0 updated for version 7.0g05
vimboss
parents: 818
diff changeset
184 let filetype = substitute(&filetype, '\.', '_', 'g')
c301dba834d0 updated for version 7.0g05
vimboss
parents: 818
diff changeset
185 let list_idx = index(s:cache_name, filetype, 0, &ignorecase)
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
186 if list_idx > -1
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
187 let compl_list = s:cache_list[list_idx]
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
188 else
871
c301dba834d0 updated for version 7.0g05
vimboss
parents: 818
diff changeset
189 let compl_list = OmniSyntaxList()
c301dba834d0 updated for version 7.0g05
vimboss
parents: 818
diff changeset
190 let s:cache_name = add( s:cache_name, filetype )
c301dba834d0 updated for version 7.0g05
vimboss
parents: 818
diff changeset
191 let s:cache_list = add( s:cache_list, compl_list )
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
192 endif
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
193
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
194 " Return list of matches.
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
195
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
196 if base != ''
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
197 " let compstr = join(compl_list, ' ')
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
198 " let expr = (b:omni_syntax_ignorecase==0?'\C':'').'\<\%('.base.'\)\@!\w\+\s*'
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
199 " let compstr = substitute(compstr, expr, '', 'g')
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
200 " let compl_list = split(compstr, '\s\+')
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
201
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
202 " Filter the list based on the first few characters the user
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
203 " entered
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
204 let expr = 'v:val '.(g:omni_syntax_ignorecase==1?'=~?':'=~#')." '^".escape(base, '\\/.*$^~[]').".*'"
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
205 let compl_list = filter(deepcopy(compl_list), expr)
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
206 endif
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
207
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
208 return compl_list
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
209 endfunc
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
210
2434
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
211 function! syntaxcomplete#OmniSyntaxList(...)
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
212 if a:0 > 0
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
213 let parms = []
3996
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
214 if 3 == type(a:1)
2434
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
215 let parms = a:1
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
216 elseif 1 == type(a:1)
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
217 let parms = split(a:1, ',')
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
218 endif
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
219 return OmniSyntaxList( parms )
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
220 else
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
221 return OmniSyntaxList()
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
222 endif
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
223 endfunc
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
224
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
225 function! OmniSyntaxList(...)
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
226 let list_parms = []
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
227 if a:0 > 0
3996
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
228 if 3 == type(a:1)
2434
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
229 let list_parms = a:1
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
230 elseif 1 == type(a:1)
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
231 let list_parms = split(a:1, ',')
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
232 endif
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
233 endif
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
234
871
c301dba834d0 updated for version 7.0g05
vimboss
parents: 818
diff changeset
235 " Default to returning a dictionary, if use_dictionary is set to 0
c301dba834d0 updated for version 7.0g05
vimboss
parents: 818
diff changeset
236 " a list will be returned.
c301dba834d0 updated for version 7.0g05
vimboss
parents: 818
diff changeset
237 " let use_dictionary = 1
c301dba834d0 updated for version 7.0g05
vimboss
parents: 818
diff changeset
238 " if a:0 > 0 && a:1 != ''
c301dba834d0 updated for version 7.0g05
vimboss
parents: 818
diff changeset
239 " let use_dictionary = a:1
c301dba834d0 updated for version 7.0g05
vimboss
parents: 818
diff changeset
240 " endif
c301dba834d0 updated for version 7.0g05
vimboss
parents: 818
diff changeset
241
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
242 " Only display items in the completion window that are at least
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
243 " this many characters in length
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
244 if !exists('b:omni_syntax_use_iskeyword')
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
245 if exists('g:omni_syntax_use_iskeyword')
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
246 let b:omni_syntax_use_iskeyword = g:omni_syntax_use_iskeyword
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
247 else
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
248 let b:omni_syntax_use_iskeyword = 1
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
249 endif
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
250 endif
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
251
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
252 " Only display items in the completion window that are at least
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
253 " this many characters in length
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
254 if !exists('b:omni_syntax_minimum_length')
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
255 if exists('g:omni_syntax_minimum_length')
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
256 let b:omni_syntax_minimum_length = g:omni_syntax_minimum_length
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
257 else
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
258 let b:omni_syntax_minimum_length = 0
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
259 endif
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
260 endif
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
261
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
262 let saveL = @l
2434
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
263 let filetype = substitute(&filetype, '\.', '_', 'g')
3996
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
264
2434
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
265 if empty(list_parms)
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
266 " Default the include group to include the requested syntax group
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
267 let syntax_group_include_{filetype} = ''
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
268 " Check if there are any overrides specified for this filetype
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
269 if exists('g:omni_syntax_group_include_'.filetype)
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
270 let syntax_group_include_{filetype} =
3996
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
271 \ substitute( g:omni_syntax_group_include_{filetype},'\s\+','','g')
2434
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
272 let list_parms = split(g:omni_syntax_group_include_{filetype}, ',')
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
273 if syntax_group_include_{filetype} =~ '\w'
3996
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
274 let syntax_group_include_{filetype} =
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
275 \ substitute( syntax_group_include_{filetype},
2434
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
276 \ '\s*,\s*', '\\|', 'g'
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
277 \ )
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
278 endif
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
279 endif
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
280 else
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
281 " A specific list was provided, use it
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
282 endif
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
283
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
284 " Loop through all the syntax groupnames, and build a
3996
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
285 " syntax file which contains these names. This can
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
286 " work generically for any filetype that does not already
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
287 " have a plugin defined.
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
288 " This ASSUMES the syntax groupname BEGINS with the name
3996
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
289 " of the filetype. From my casual viewing of the vim7\syntax
2434
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
290 " directory this is true for almost all syntax definitions.
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
291 " As an example, the SQL syntax groups have this pattern:
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
292 " sqlType
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
293 " sqlOperators
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
294 " sqlKeyword ...
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
295 if !empty(list_parms) && empty(substitute(join(list_parms), '[a-zA-Z ]', '', 'g'))
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
296 " If list_parms only includes word characters, use it to limit
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
297 " the syntax elements.
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
298 " If using regex syntax list will fail to find those items, so
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
299 " simply grab the who syntax list.
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
300 redir @l
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
301 silent! exec 'syntax list '.join(list_parms)
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
302 redir END
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
303 else
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
304 redir @l
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
305 silent! exec 'syntax list'
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
306 redir END
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
307 endif
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
308
702
8a99b25de218 updated for version 7.0212
vimboss
parents: 625
diff changeset
309 let syntax_full = "\n".@l
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
310 let @l = saveL
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
311
3996
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
312 if syntax_full =~ 'E28'
702
8a99b25de218 updated for version 7.0212
vimboss
parents: 625
diff changeset
313 \ || syntax_full =~ 'E411'
8a99b25de218 updated for version 7.0212
vimboss
parents: 625
diff changeset
314 \ || syntax_full =~ 'E415'
8a99b25de218 updated for version 7.0212
vimboss
parents: 625
diff changeset
315 \ || syntax_full =~ 'No Syntax items'
8a99b25de218 updated for version 7.0212
vimboss
parents: 625
diff changeset
316 return []
8a99b25de218 updated for version 7.0212
vimboss
parents: 625
diff changeset
317 endif
8a99b25de218 updated for version 7.0212
vimboss
parents: 625
diff changeset
318
871
c301dba834d0 updated for version 7.0g05
vimboss
parents: 818
diff changeset
319 let filetype = substitute(&filetype, '\.', '_', 'g')
c301dba834d0 updated for version 7.0g05
vimboss
parents: 818
diff changeset
320
2434
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
321 let list_exclude_groups = []
3996
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
322 if a:0 > 0
2434
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
323 " Do nothing since we have specific a specific list of groups
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
324 else
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
325 " Default the exclude group to nothing
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
326 let syntax_group_exclude_{filetype} = ''
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
327 " Check if there are any overrides specified for this filetype
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
328 if exists('g:omni_syntax_group_exclude_'.filetype)
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
329 let syntax_group_exclude_{filetype} =
3996
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
330 \ substitute( g:omni_syntax_group_exclude_{filetype},'\s\+','','g')
2434
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
331 let list_exclude_groups = split(g:omni_syntax_group_exclude_{filetype}, ',')
3996
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
332 if syntax_group_exclude_{filetype} =~ '\w'
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
333 let syntax_group_exclude_{filetype} =
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
334 \ substitute( syntax_group_exclude_{filetype},
2434
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
335 \ '\s*,\s*', '\\|', 'g'
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
336 \ )
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
337 endif
702
8a99b25de218 updated for version 7.0212
vimboss
parents: 625
diff changeset
338 endif
8a99b25de218 updated for version 7.0212
vimboss
parents: 625
diff changeset
339 endif
8a99b25de218 updated for version 7.0212
vimboss
parents: 625
diff changeset
340
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
341 if empty(list_parms)
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
342 let list_parms = [&filetype.'\w\+']
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
343 endif
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
344
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
345 let syn_list = ''
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
346 let index = 0
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
347 for group_regex in list_parms
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
348 " Sometimes filetypes can be composite names, like c.doxygen
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
349 " Loop through each individual part looking for the syntax
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
350 " items specific to each individual filetype.
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
351 " let ftindex = 0
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
352 " let ftindex = match(syntax_full, group_regex, ftindex)
871
c301dba834d0 updated for version 7.0g05
vimboss
parents: 818
diff changeset
353
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
354 " while ftindex > -1
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
355 " let ft_part_name = matchstr( syntax_full, '\w\+', ftindex )
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
356
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
357 " Syntax rules can contain items for more than just the current
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
358 " filetype. They can contain additional items added by the user
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
359 " via autocmds or their vimrc.
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
360 " Some syntax files can be combined (html, php, jsp).
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
361 " We want only items that begin with the filetype we are interested in.
2434
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
362 let next_group_regex = '\n' .
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
363 \ '\zs'.group_regex.'\ze'.
3996
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
364 \ '\s\+xxx\s\+'
2434
86532ee3ea41 Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents: 2072
diff changeset
365 let index = match(syntax_full, next_group_regex, index)
3996
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
366
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
367 " For the matched group name, strip off any of the regex special
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
368 " characters and see if we get a match with the current syntax
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
369 if index == -1 && exists('b:current_syntax') && substitute(group_regex, '[^a-zA-Z ]\+.*', '', 'g') !~ '^'.b:current_syntax
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
370 " There appears to be two standards when writing syntax files.
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
371 " Either items begin as:
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
372 " syn keyword {filetype}Keyword values ...
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
373 " let b:current_syntax = "sql"
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
374 " let b:current_syntax = "sqlanywhere"
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
375 " Or
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
376 " syn keyword {syntax_filename}Keyword values ...
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
377 " let b:current_syntax = "mysql"
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
378 " So, we will make the format of finding the syntax group names
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
379 " a bit more flexible and look for both if the first fails to
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
380 " find a match.
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
381 let next_group_regex = '\n' .
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
382 \ '\zs'.b:current_syntax.'\w\+\ze'.
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
383 \ '\s\+xxx\s\+'
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
384 let index = 0
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
385 let index = match(syntax_full, next_group_regex, index)
871
c301dba834d0 updated for version 7.0g05
vimboss
parents: 818
diff changeset
386 endif
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
387
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
388 while index > -1
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
389 let group_name = matchstr( syntax_full, '\w\+', index )
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
390
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
391 let get_syn_list = 1
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
392 for exclude_group_name in list_exclude_groups
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
393 if '\<'.exclude_group_name.'\>' =~ '\<'.group_name.'\>'
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
394 let get_syn_list = 0
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
395 endif
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
396 endfor
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
397
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
398 " This code is no longer needed in version 6.0 since we have
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
399 " augmented the syntax list command to only retrieve the syntax
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
400 " groups we are interested in.
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
401 "
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
402 " if get_syn_list == 1
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
403 " if syntax_group_include_{filetype} != ''
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
404 " if '\<'.syntax_group_include_{filetype}.'\>' !~ '\<'.group_name.'\>'
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
405 " let get_syn_list = 0
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
406 " endif
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
407 " endif
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
408 " endif
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
409
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
410 if get_syn_list == 1
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
411 " Pass in the full syntax listing, plus the group name we
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
412 " are interested in.
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
413 let extra_syn_list = s:SyntaxCSyntaxGroupItems(group_name, syntax_full)
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
414 let syn_list = syn_list . extra_syn_list . "\n"
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
415 endif
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
416
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
417 let index = index + strlen(group_name)
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
418 let index = match(syntax_full, next_group_regex, index)
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
419 endwhile
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
420
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
421 " let ftindex = ftindex + len(ft_part_name)
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
422 " let ftindex = match( syntax_full, group_regex, ftindex )
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
423 " endwhile
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
424 endfor
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
425
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
426 " " Sometimes filetypes can be composite names, like c.doxygen
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
427 " " Loop through each individual part looking for the syntax
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
428 " " items specific to each individual filetype.
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
429 " let syn_list = ''
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
430 " let ftindex = 0
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
431 " let ftindex = match(&filetype, '\w\+', ftindex)
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
432
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
433 " while ftindex > -1
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
434 " let ft_part_name = matchstr( &filetype, '\w\+', ftindex )
871
c301dba834d0 updated for version 7.0g05
vimboss
parents: 818
diff changeset
435
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
436 " " Syntax rules can contain items for more than just the current
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
437 " " filetype. They can contain additional items added by the user
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
438 " " via autocmds or their vimrc.
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
439 " " Some syntax files can be combined (html, php, jsp).
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
440 " " We want only items that begin with the filetype we are interested in.
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
441 " let next_group_regex = '\n' .
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
442 " \ '\zs'.ft_part_name.'\w\+\ze'.
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
443 " \ '\s\+xxx\s\+'
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
444 " let index = 0
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
445 " let index = match(syntax_full, next_group_regex, index)
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
446
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
447 " if index == -1 && exists('b:current_syntax') && ft_part_name != b:current_syntax
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
448 " " There appears to be two standards when writing syntax files.
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
449 " " Either items begin as:
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
450 " " syn keyword {filetype}Keyword values ...
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
451 " " let b:current_syntax = "sql"
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
452 " " let b:current_syntax = "sqlanywhere"
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
453 " " Or
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
454 " " syn keyword {syntax_filename}Keyword values ...
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
455 " " let b:current_syntax = "mysql"
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
456 " " So, we will make the format of finding the syntax group names
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
457 " " a bit more flexible and look for both if the first fails to
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
458 " " find a match.
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
459 " let next_group_regex = '\n' .
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
460 " \ '\zs'.b:current_syntax.'\w\+\ze'.
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
461 " \ '\s\+xxx\s\+'
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
462 " let index = 0
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
463 " let index = match(syntax_full, next_group_regex, index)
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
464 " endif
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
465
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
466 " while index > -1
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
467 " let group_name = matchstr( syntax_full, '\w\+', index )
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
468
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
469 " let get_syn_list = 1
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
470 " for exclude_group_name in list_exclude_groups
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
471 " if '\<'.exclude_group_name.'\>' =~ '\<'.group_name.'\>'
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
472 " let get_syn_list = 0
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
473 " endif
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
474 " endfor
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
475
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
476 " " This code is no longer needed in version 6.0 since we have
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
477 " " augmented the syntax list command to only retrieve the syntax
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
478 " " groups we are interested in.
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
479 " "
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
480 " " if get_syn_list == 1
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
481 " " if syntax_group_include_{filetype} != ''
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
482 " " if '\<'.syntax_group_include_{filetype}.'\>' !~ '\<'.group_name.'\>'
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
483 " " let get_syn_list = 0
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
484 " " endif
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
485 " " endif
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
486 " " endif
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
487
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
488 " if get_syn_list == 1
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
489 " " Pass in the full syntax listing, plus the group name we
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
490 " " are interested in.
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
491 " let extra_syn_list = s:SyntaxCSyntaxGroupItems(group_name, syntax_full)
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
492 " let syn_list = syn_list . extra_syn_list . "\n"
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
493 " endif
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
494
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
495 " let index = index + strlen(group_name)
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
496 " let index = match(syntax_full, next_group_regex, index)
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
497 " endwhile
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
498
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
499 " let ftindex = ftindex + len(ft_part_name)
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
500 " let ftindex = match( &filetype, '\w\+', ftindex )
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
501 " endwhile
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
502
702
8a99b25de218 updated for version 7.0212
vimboss
parents: 625
diff changeset
503 " Convert the string to a List and sort it.
8a99b25de218 updated for version 7.0212
vimboss
parents: 625
diff changeset
504 let compl_list = sort(split(syn_list))
8a99b25de218 updated for version 7.0212
vimboss
parents: 625
diff changeset
505
8a99b25de218 updated for version 7.0212
vimboss
parents: 625
diff changeset
506 if &filetype == 'vim'
8a99b25de218 updated for version 7.0212
vimboss
parents: 625
diff changeset
507 let short_compl_list = []
8a99b25de218 updated for version 7.0212
vimboss
parents: 625
diff changeset
508 for i in range(len(compl_list))
8a99b25de218 updated for version 7.0212
vimboss
parents: 625
diff changeset
509 if i == len(compl_list)-1
8a99b25de218 updated for version 7.0212
vimboss
parents: 625
diff changeset
510 let next = i
8a99b25de218 updated for version 7.0212
vimboss
parents: 625
diff changeset
511 else
8a99b25de218 updated for version 7.0212
vimboss
parents: 625
diff changeset
512 let next = i + 1
8a99b25de218 updated for version 7.0212
vimboss
parents: 625
diff changeset
513 endif
8a99b25de218 updated for version 7.0212
vimboss
parents: 625
diff changeset
514 if compl_list[next] !~ '^'.compl_list[i].'.$'
8a99b25de218 updated for version 7.0212
vimboss
parents: 625
diff changeset
515 let short_compl_list += [compl_list[i]]
8a99b25de218 updated for version 7.0212
vimboss
parents: 625
diff changeset
516 endif
8a99b25de218 updated for version 7.0212
vimboss
parents: 625
diff changeset
517 endfor
8a99b25de218 updated for version 7.0212
vimboss
parents: 625
diff changeset
518
8a99b25de218 updated for version 7.0212
vimboss
parents: 625
diff changeset
519 return short_compl_list
8a99b25de218 updated for version 7.0212
vimboss
parents: 625
diff changeset
520 else
8a99b25de218 updated for version 7.0212
vimboss
parents: 625
diff changeset
521 return compl_list
8a99b25de218 updated for version 7.0212
vimboss
parents: 625
diff changeset
522 endif
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
523 endfunction
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
524
818
1f929f3ca806 updated for version 7.0c03
vimboss
parents: 785
diff changeset
525 function! s:SyntaxCSyntaxGroupItems( group_name, syntax_full )
702
8a99b25de218 updated for version 7.0212
vimboss
parents: 625
diff changeset
526
8a99b25de218 updated for version 7.0212
vimboss
parents: 625
diff changeset
527 let syn_list = ""
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
528
702
8a99b25de218 updated for version 7.0212
vimboss
parents: 625
diff changeset
529 " From the full syntax listing, strip out the portion for the
8a99b25de218 updated for version 7.0212
vimboss
parents: 625
diff changeset
530 " request group.
8a99b25de218 updated for version 7.0212
vimboss
parents: 625
diff changeset
531 " Query:
8a99b25de218 updated for version 7.0212
vimboss
parents: 625
diff changeset
532 " \n - must begin with a newline
8a99b25de218 updated for version 7.0212
vimboss
parents: 625
diff changeset
533 " a:group_name - the group name we are interested in
8a99b25de218 updated for version 7.0212
vimboss
parents: 625
diff changeset
534 " \s\+xxx\s\+ - group names are always followed by xxx
8a99b25de218 updated for version 7.0212
vimboss
parents: 625
diff changeset
535 " \zs - start the match
8a99b25de218 updated for version 7.0212
vimboss
parents: 625
diff changeset
536 " .\{-} - everything ...
8a99b25de218 updated for version 7.0212
vimboss
parents: 625
diff changeset
537 " \ze - end the match
2072
4a1bcdd9ea55 Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1620
diff changeset
538 " \( - start a group or 2 potential matches
702
8a99b25de218 updated for version 7.0212
vimboss
parents: 625
diff changeset
539 " \n\w - at the first newline starting with a character
2072
4a1bcdd9ea55 Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1620
diff changeset
540 " \| - 2nd potential match
4a1bcdd9ea55 Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1620
diff changeset
541 " \%$ - matches end of the file or string
4a1bcdd9ea55 Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1620
diff changeset
542 " \) - end a group
3996
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
543 let syntax_group = matchstr(a:syntax_full,
2072
4a1bcdd9ea55 Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1620
diff changeset
544 \ "\n".a:group_name.'\s\+xxx\s\+\zs.\{-}\ze\(\n\w\|\%$\)'
871
c301dba834d0 updated for version 7.0g05
vimboss
parents: 818
diff changeset
545 \ )
702
8a99b25de218 updated for version 7.0212
vimboss
parents: 625
diff changeset
546
8a99b25de218 updated for version 7.0212
vimboss
parents: 625
diff changeset
547 if syntax_group != ""
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
548 " let syn_list = substitute( @l, '^.*xxx\s*\%(contained\s*\)\?', "", '' )
702
8a99b25de218 updated for version 7.0212
vimboss
parents: 625
diff changeset
549 " let syn_list = substitute( @l, '^.*xxx\s*', "", '' )
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
550
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
551 " We only want the words for the lines begining with
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
552 " containedin, but there could be other items.
3996
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
553
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
554 " Tried to remove all lines that do not begin with contained
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
555 " but this does not work in all cases since you can have
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
556 " contained nextgroup=...
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
557 " So this will strip off the ending of lines with known
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
558 " keywords.
3996
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
559 let syn_list = substitute(
871
c301dba834d0 updated for version 7.0g05
vimboss
parents: 818
diff changeset
560 \ syntax_group, '\<\('.
c301dba834d0 updated for version 7.0g05
vimboss
parents: 818
diff changeset
561 \ substitute(
c301dba834d0 updated for version 7.0g05
vimboss
parents: 818
diff changeset
562 \ escape(s:syn_remove_words, '\\/.*$^~[]')
c301dba834d0 updated for version 7.0g05
vimboss
parents: 818
diff changeset
563 \ , ',', '\\|', 'g'
c301dba834d0 updated for version 7.0g05
vimboss
parents: 818
diff changeset
564 \ ).
c301dba834d0 updated for version 7.0g05
vimboss
parents: 818
diff changeset
565 \ '\).\{-}\%($\|'."\n".'\)'
3996
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
566 \ , "\n", 'g'
871
c301dba834d0 updated for version 7.0g05
vimboss
parents: 818
diff changeset
567 \ )
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
568
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
569 " Attempt to deal with lines using the match syntax
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
570 " javaScriptDocTags xxx match /@\(param\|argument\|requires\|file\)\>/
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
571 " Though it can use any types of regex, so this plugin will attempt
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
572 " to restrict it
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
573 " 1. Only use \( or \%( constructs remove all else
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
574 " 2 Remove and []s
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
575 " 3. Account for match //constructs
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
576 " \%(\%(ms\|me\|hs\|he\|rs\|re\|lc\)\S\+\)\?
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
577 " 4. Hope for the best
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
578 "
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
579 "
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
580 let syn_list_old = syn_list
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
581 while syn_list =~ '\<match\>\s\+\/'
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
582 if syn_list =~ 'perlElseIfError'
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
583 let syn_list = syn_list
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
584 endif
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
585 " Check if the match has words at least 3 characters long
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
586 if syn_list =~ '\<match \/\zs.\{-}\<\w\{3,}\>.\{-}\ze\\\@<!\/\%(\%(ms\|me\|hs\|he\|rs\|re\|lc\)\S\+\)\?\s\+'
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
587 " Remove everything after / and before the first \(
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
588 let syn_list = substitute( syn_list, '\<match \/\zs.\{-}\ze\\%\?(.\{-}\\\@<!\/\%(\%(ms\|me\|hs\|he\|rs\|re\|lc\)\S\+\)\?\s\+', '', 'g' )
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
589 " Remove everything after \) and up to the ending /
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
590 let syn_list = substitute( syn_list, '\<match \/.\{-}\\)\zs.\{-}\ze\/\%(\%(ms\|me\|hs\|he\|rs\|re\|lc\)\S\+\)\?\s\+', '', 'g' )
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
591
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
592 " Remove any character classes
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
593 " let syn_list = substitute( syn_list, '\<match /\zs.\{-}\[[^]]*\].\{-}\ze\/ ', '', 'g' )
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
594 let syn_list = substitute( syn_list, '\%(\<match \/[^/]\{-}\)\@<=\[[^]]*\]\ze.\{-}\\\@<!\/\%(\%(ms\|me\|hs\|he\|rs\|re\|lc\)\S\+\)\?', '', 'g' )
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
595 " Remove any words < 3 characters
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
596 let syn_list = substitute( syn_list, '\%(\<match \/[^/]\{-}\)\@<=\<\w\{1,2}\>\ze.\{-}\\\@<!\/\%(\%(ms\|me\|hs\|he\|rs\|re\|lc\)\S\+\)\?\s\+', '', 'g' )
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
597 " Remove all non-word characters
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
598 " let syn_list = substitute( syn_list, '\<match /\zs.\{-}\<\W\+\>.\{-}\ze\/ ', "", 'g' )
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
599 " let syn_list = substitute( syn_list, '\%(\<match \/[^/]\{-}\)\@<=\W\+\ze.\{-}\/ ', ' ', 'g' )
17758
f2c2f9126a82 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 4437
diff changeset
600 " Do this by using the outer substitute() call to gather all
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
601 " text between the match /.../ tags.
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
602 " The inner substitute() call operates on the text selected
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
603 " and replaces all non-word characters.
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
604 let syn_list = substitute( syn_list, '\<match \/\zs\(.\{-}\)\ze\\\@<!\/\%(\%(ms\|me\|hs\|he\|rs\|re\|lc\)\S\+\)\?\s\+'
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
605 \ , '\=substitute(submatch(1), "\\W\\+", " ", "g")'
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
606 \ , 'g' )
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
607 " Remove the match / / syntax
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
608 let syn_list = substitute( syn_list, '\<match \/\(.\{-}\)\/\%(\%(ms\|me\|hs\|he\|rs\|re\|lc\)\S\+\)\?\s\+', '\1', 'g' )
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
609 else
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
610 " No words long enough, remove the match
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
611 " Remove the match syntax
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
612 " let syn_list = substitute( syn_list, '\<match \/[^\/]*\/\%(\%(ms\|me\|hs\|he\|rs\|re\|lc\)\S\+\)\?\s\+', '', 'g' )
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
613 let syn_list = substitute( syn_list, '\<match \/\%(.\{-}\)\?\/\%(\%(ms\|me\|hs\|he\|rs\|re\|lc\)\S\+\)\?\s\+', '', 'g' )
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
614 endif
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
615 if syn_list =~ '\<match\>\s\+\/'
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
616 " Problem removing the match / / tags
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
617 let syn_list = ''
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
618 endif
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
619 endwhile
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
620
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
621
3224
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2434
diff changeset
622 " Now strip off the newline + blank space + contained.
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2434
diff changeset
623 " Also include lines with nextgroup=@someName skip_key_words syntax_element
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
624 " \ syn_list, '\%(^\|\n\)\@<=\s*\<\(contained\|nextgroup=\)'
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
625 " \ syn_list, '\%(^\|\n\)\@<=\s*\<\(contained\|nextgroup=[@a-zA-Z,]*\)'
3996
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
626 let syn_list = substitute(
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
627 \ syn_list, '\<\(contained\|nextgroup=[@a-zA-Z,]*\)'
3996
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
628 \ , "", 'g'
3224
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2434
diff changeset
629 \ )
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2434
diff changeset
630
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2434
diff changeset
631 " This can leave lines like this
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2434
diff changeset
632 " =@vimMenuList skipwhite onoremenu
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2434
diff changeset
633 " Strip the special option keywords first
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2434
diff changeset
634 " :h :syn-skipwhite*
3996
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
635 let syn_list = substitute(
3224
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2434
diff changeset
636 \ syn_list, '\<\(skipwhite\|skipnl\|skipempty\)\>'
3996
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
637 \ , "", 'g'
3224
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2434
diff changeset
638 \ )
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2434
diff changeset
639
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2434
diff changeset
640 " Now remove the remainder of the nextgroup=@someName lines
3996
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
641 let syn_list = substitute(
3224
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2434
diff changeset
642 \ syn_list, '\%(^\|\n\)\@<=\s*\(@\w\+\)'
3996
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
643 \ , "", 'g'
871
c301dba834d0 updated for version 7.0g05
vimboss
parents: 818
diff changeset
644 \ )
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
645
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
646 if b:omni_syntax_use_iskeyword == 0
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
647 " There are a number of items which have non-word characters in
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
648 " them, *'T_F1'*. vim.vim is one such file.
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
649 " This will replace non-word characters with spaces.
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
650 let syn_list = substitute( syn_list, '[^0-9A-Za-z_ ]', ' ', 'g' )
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
651 else
3920
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
652 if g:omni_syntax_use_iskeyword_numeric == 1
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
653 " iskeyword can contain value like this
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
654 " 38,42,43,45,47-58,60-62,64-90,97-122,_,+,-,*,/,%,<,=,>,:,$,?,!,@-@,94
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
655 " Numeric values convert to their ASCII equivalent using the
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
656 " nr2char() function.
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
657 " & 38
3996
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
658 " * 42
3920
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
659 " + 43
3996
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
660 " - 45
3920
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
661 " ^ 94
3996
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
662 " Iterate through all numeric specifications and convert those
3920
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
663 " to their ascii equivalent ensuring the character is printable.
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
664 " If so, add it to the list.
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
665 let accepted_chars = ''
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
666 for item in split(&iskeyword, ',')
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3996
diff changeset
667 if item =~ '\d-\d'
3996
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
668 " This is a character range (ie 47-58),
3920
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
669 " cycle through each character within the range
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
670 let [b:start, b:end] = split(item, '-')
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
671 for range_item in range( b:start, b:end )
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
672 if range_item <= 127 || g:omni_syntax_use_single_byte == 0
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
673 if nr2char(range_item) =~ '\p'
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
674 let accepted_chars = accepted_chars . nr2char(range_item)
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
675 endif
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
676 endif
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
677 endfor
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
678 elseif item =~ '^\d\+$'
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
679 " Only numeric, translate to a character
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
680 if item < 127 || g:omni_syntax_use_single_byte == 0
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
681 if nr2char(item) =~ '\p'
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
682 let accepted_chars = accepted_chars . nr2char(item)
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
683 endif
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
684 endif
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
685 else
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
686 if char2nr(item) < 127 || g:omni_syntax_use_single_byte == 0
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
687 if item =~ '\p'
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
688 let accepted_chars = accepted_chars . item
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
689 endif
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
690 endif
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
691 endif
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
692 endfor
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
693 " Escape special regex characters
3996
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
694 " Looks like the wrong chars are escaped. In a collection,
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
695 " :h /[]
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
696 " only `]', `\', `-' and `^' are special:
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
697 " let accepted_chars = escape(accepted_chars, '\\/.*$^~[]' )
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
698 let accepted_chars = escape(accepted_chars, ']\-^' )
3920
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
699 " Remove all characters that are not acceptable
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
700 let syn_list = substitute( syn_list, '[^A-Za-z'.accepted_chars.']', ' ', 'g' )
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
701 else
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
702 let accept_chars = ','.&iskeyword.','
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
703 " Remove all character ranges
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
704 " let accept_chars = substitute(accept_chars, ',[^,]\+-[^,]\+,', ',', 'g')
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
705 let accept_chars = substitute(accept_chars, ',\@<=[^,]\+-[^,]\+,', '', 'g')
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
706 " Remove all numeric specifications
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
707 " let accept_chars = substitute(accept_chars, ',\d\{-},', ',', 'g')
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
708 let accept_chars = substitute(accept_chars, ',\@<=\d\{-},', '', 'g')
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
709 " Remove all commas
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
710 let accept_chars = substitute(accept_chars, ',', '', 'g')
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
711 " Escape special regex characters
3996
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
712 " Looks like the wrong chars are escaped. In a collection,
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
713 " :h /[]
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
714 " only `]', `\', `-' and `^' are special:
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
715 " let accept_chars = escape(accept_chars, '\\/.*$^~[]' )
b3f3237a3d72 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3920
diff changeset
716 let accept_chars = escape(accept_chars, ']\-^' )
3920
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
717 " Remove all characters that are not acceptable
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
718 let syn_list = substitute( syn_list, '[^0-9A-Za-z_'.accept_chars.']', ' ', 'g' )
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
719 endif
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
720 endif
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
721
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
722 if b:omni_syntax_minimum_length > 0
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
723 " If the user specified a minimum length, enforce it
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
724 let syn_list = substitute(' '.syn_list.' ', ' \S\{,'.b:omni_syntax_minimum_length.'}\ze ', ' ', 'g')
e63691e7c504 updated for version 7.1a
vimboss
parents: 871
diff changeset
725 endif
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
726 else
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
727 let syn_list = ''
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
728 endif
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
729
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
730 return syn_list
81fe2ccc1207 updated for version 7.0179
vimboss
parents:
diff changeset
731 endfunction
3920
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
732
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
733 function! OmniSyntaxShowChars(spec)
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
734 let result = []
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
735 for item in split(a:spec, ',')
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
736 if len(item) > 1
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
737 if item == '@-@'
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
738 call add(result, char2nr(item))
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
739 else
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
740 call extend(result, call('range', split(item, '-')))
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
741 endif
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
742 else
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
743 if item == '@' " assume this is [A-Za-z]
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
744 for [c1, c2] in [['A', 'Z'], ['a', 'z']]
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
745 call extend(result, range(char2nr(c1), char2nr(c2)))
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
746 endfor
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
747 else
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
748 call add(result, char2nr(item))
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
749 endif
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
750 endif
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
751 endfor
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
752 return join(map(result, 'nr2char(v:val)'), ', ')
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
753 endfunction
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
754 let &cpo = s:cpo_save
c53344bacabf Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3224
diff changeset
755 unlet s:cpo_save