diff options
author | Peter Odding <peter@peterodding.com> | 2011-10-29 17:32:33 +0200 |
---|---|---|
committer | Peter Odding <peter@peterodding.com> | 2011-10-29 17:32:33 +0200 |
commit | e3290ab006edf7c262a0bd117577043ce33435c6 (patch) | |
tree | a67768ae63c5b8005ca4d290e00ce3a7c26c208d /misc | |
parent | 3d7e09100e74d84a94996447e79594d3911a4c9a (diff) | |
download | vim-easytags-e3290ab006edf7c262a0bd117577043ce33435c6.tar.gz |
Make list of ignored syntax groups configurable
While trying to fix issue #20 I decided to refactor the code that
handles ignored syntax groups: Previously the list of excluded groups
was hard coded in two places, now it's a configuration option. Then
it turned out that including shFunction* in the list of excluded
syntax groups didn't fix the reported issue...
Diffstat (limited to 'misc')
-rw-r--r-- | misc/easytags/highlight.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/misc/easytags/highlight.py b/misc/easytags/highlight.py index b7a9cf3..154854e 100644 --- a/misc/easytags/highlight.py +++ b/misc/easytags/highlight.py @@ -5,7 +5,7 @@ syntax highlighting by reimplementing tag file reading and :syntax command generation in Python with a focus on doing the least amount of work. Author: Peter Odding <peter@peterodding.com> -Last Change: June 14, 2011 +Last Change: October 29, 2011 URL: http://peterodding.com/code/vim/easytags ''' @@ -18,7 +18,7 @@ import sys def easytags_ping(): print 'it works!' -def easytags_gensyncmd(tagsfiles, filetype, tagkinds, syntaxgroup, prefix, suffix, filters): +def easytags_gensyncmd(tagsfiles, filetype, tagkinds, syntaxgroup, prefix, suffix, filters, ignoresyntax): # Get arguments from Vim. if filters: tagkinds = filters['kind'] @@ -43,13 +43,13 @@ def easytags_gensyncmd(tagsfiles, filetype, tagkinds, syntaxgroup, prefix, suffi patterns.append(escaped) counter += len(escaped) if counter > limit: - commands.append(_easytags_makecmd(syntaxgroup, prefix, suffix, patterns)) + commands.append(_easytags_makecmd(syntaxgroup, prefix, suffix, patterns, ignoresyntax)) patterns = [] counter = 0 if patterns: - commands.append(_easytags_makecmd(syntaxgroup, prefix, suffix, patterns)) + commands.append(_easytags_makecmd(syntaxgroup, prefix, suffix, patterns, ignoresyntax)) return ' | '.join(commands) -def _easytags_makecmd(syntaxgroup, prefix, suffix, patterns): - template = r'syntax match %s /%s\%%(%s\)%s/ containedin=ALLBUT,.*String.*,.*Comment.*,cIncluded' - return template % (syntaxgroup, prefix, r'\|'.join(patterns), suffix) +def _easytags_makecmd(syntaxgroup, prefix, suffix, patterns, ignoresyntax): + template = r'syntax match %s /%s\%%(%s\)%s/ containedin=ALLBUT,%s' + return template % (syntaxgroup, prefix, r'\|'.join(patterns), suffix, ignoresyntax) |