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

Correct the name to properly escape out any special chars for the substitution (#740)

This commit is contained in:
raven42
2021-01-15 06:14:27 -06:00
committed by GitHub
parent a52610c009
commit 59eef1364d

View File

@@ -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