From 59eef1364d8ebb16ceb8dba4274f3926f3c3b7f0 Mon Sep 17 00:00:00 2001 From: raven42 Date: Fri, 15 Jan 2021 06:14:27 -0600 Subject: [PATCH] Correct the name to properly escape out any special chars for the substitution (#740) --- autoload/tagbar/prototypes/normaltag.vim | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/autoload/tagbar/prototypes/normaltag.vim b/autoload/tagbar/prototypes/normaltag.vim index 6aaeb40..a5916d2 100644 --- a/autoload/tagbar/prototypes/normaltag.vim +++ b/autoload/tagbar/prototypes/normaltag.vim @@ -152,11 +152,7 @@ function! s:getDataType() abort dict endif let line = getbufline(bufnr, self.fields.line)[0] - if (self.name =~# '^\s*\~') - let data_type = '' - else - let data_type = substitute(line, '\s*' . self.name . '.*', '', '') - endif + let data_type = substitute(line, '\s*' . escape(self.name, '~') . '.*', '', '') " Strip off the path if we have one along with any spaces prior to the " path