Skip to content

fix slow highlighter on vim 7.4 #80

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions autoload/xolox/easytags.vim
Original file line number Diff line number Diff line change
Expand Up @@ -462,9 +462,8 @@ function! xolox#easytags#highlight() " {{{2
if matches != []
" Convert matched tags to :syntax command and execute it.
let matches = xolox#misc#list#unique(map(matches, 'xolox#misc#escape#pattern(get(v:val, "name"))'))
let pattern = tagkind.pattern_prefix . '\%(' . join(matches, '\|') . '\)' . tagkind.pattern_suffix
let template = 'syntax match %s /%s/ containedin=ALLBUT,%s'
let command = printf(template, hlgroup_tagged, escape(pattern, '/'), xolox#easytags#syntax_groups_to_ignore())
let template = 'syntax keyword %s %s containedin=ALLBUT,%s'
let command = printf(template, hlgroup_tagged, join(matches, ' '), xolox#easytags#syntax_groups_to_ignore())
call xolox#misc#msg#debug("easytags.vim %s: Executing command '%s'.", g:xolox#easytags#version, command)
try
execute command
Expand Down
4 changes: 2 additions & 2 deletions misc/easytags/highlight.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@ def easytags_gensyncmd(tagsfiles, filetype, tagkinds, syntaxgroup, prefix, suffi
return ' | '.join(commands)

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)
template = r'syntax keyword %s %s containedin=ALLBUT,%s'
return template % (syntaxgroup, r' '.join(patterns), ignoresyntax)