Skip to content

Commit d7ed1ca

Browse files
committed
highlight only keyword
1 parent 1249d42 commit d7ed1ca

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

autoload/hl_matchit.vim

+5-2
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,13 @@ function! hl_matchit#do_highlight()
124124
let lcre = join(lcs, '\|')
125125
let mw = split(b:match_words, ',\|:')
126126
let mw = filter(mw, 'v:val !~ "^[(){}[\\]]$"')
127+
if &filetype =~# 'html'
128+
" hack to improve html
129+
call insert(mw, '<\_[^>]\+>')
130+
endif
127131
let mwre = '\%(' . join(mw, '\|') . '\)'
128132
let mwre = substitute(mwre, "'", "''", 'g')
129-
" final \& part of the regexp is a hack to improve html
130-
let pattern = '.*\%(' . lcre . '\).*\&' . mwre . '\&\%(<\_[^>]\+>\|.*\)'
133+
let pattern = '.*\%(' . lcre . '\).*\&' . mwre
131134
let b:hl_matchit_current_match_id =
132135
\ matchadd(g:hl_matchit_hl_groupname, pattern, g:hl_matchit_hl_priority)
133136
endif

0 commit comments

Comments
 (0)