annotate runtime/autoload/syntaxcomplete.vim @ 32774:1b2730ece70e

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