From 978e1fe761de8be1f4d6c8469deba74a3cc0872f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E8=82=B2=E9=9C=96?= Date: Thu, 7 Jan 2021 21:31:45 +0800 Subject: [PATCH] Fix the problem that the data type was unexpectedly displayed in the C++ destructor's tag. (#734) * Fix the problem that the data type was unexpectedly displayed in the C++ destructor's tag. * Update autoload/tagbar/prototypes/normaltag.vim Co-authored-by: Caleb Maclennan --- autoload/tagbar/prototypes/normaltag.vim | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/autoload/tagbar/prototypes/normaltag.vim b/autoload/tagbar/prototypes/normaltag.vim index a192f97..6aaeb40 100644 --- a/autoload/tagbar/prototypes/normaltag.vim +++ b/autoload/tagbar/prototypes/normaltag.vim @@ -152,8 +152,11 @@ function! s:getDataType() abort dict endif let line = getbufline(bufnr, self.fields.line)[0] - let tmp_name = substitute(self.name, "\\~", '', 'g') - let data_type = substitute(line, '\s*' . tmp_name . '.*', '', '') + if (self.name =~# '^\s*\~') + let data_type = '' + else + let data_type = substitute(line, '\s*' . self.name . '.*', '', '') + endif " Strip off the path if we have one along with any spaces prior to the " path