From e3290ab006edf7c262a0bd117577043ce33435c6 Mon Sep 17 00:00:00 2001 From: Peter Odding Date: Sat, 29 Oct 2011 17:32:33 +0200 Subject: 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... --- misc/easytags/highlight.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'misc/easytags') 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 -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) -- cgit v1.2.3