1
0
mirror of https://github.com/gryf/tagbar.git synced 2025-12-17 11:30:28 +01:00

Escape special characters in pattern searching (#737)

This commit is contained in:
沈育霖
2021-01-13 01:45:53 +08:00
committed by GitHub
parent e6e6582739
commit c7e7d5e565

View File

@@ -2288,7 +2288,7 @@ function! s:HighlightTag(openfolds, ...) abort
" If printing the line number of the tag to the left, and the tag is
" visible (I.E. parent isn't folded)
let identifier = '\zs\V' . tag.name . '\m\ze'
let identifier = '\zs\V' . escape(tag.name, '/\') . '\m\ze'
if g:tagbar_show_tag_linenumbers == 2 && tagline == tag.tline
let pattern = '/^\%' . tagline . 'l\s*' . foldpat . '[-+# ]\[[0-9]\+\] \?' . identifier . '/'
else