From e5c864738db6135a27b6373585d6f4987ffdddb5 Mon Sep 17 00:00:00 2001 From: bravestarr Date: Sat, 29 Aug 2020 22:59:53 +0800 Subject: [PATCH] Fix issue with jumping to a tag with special characters (#649) In C++, the name of the destructor of a class starts with a tidle(~) which is special when the option 'magic' is set. This will cause an error when jumping to a destructor. Call search() in "very nomagic" environment can solve this problem no matter the option 'magic' is set or not. --- autoload/tagbar.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/tagbar.vim b/autoload/tagbar.vim index c825b97..68d8f94 100644 --- a/autoload/tagbar.vim +++ b/autoload/tagbar.vim @@ -2250,7 +2250,7 @@ function! s:JumpToTag(stay_in_tagbar) abort call cursor(taginfo.fields.line, taginfo.fields.column) else call cursor(taginfo.fields.line, 1) - call search(taginfo.name, 'c', line('.')) + call search('\V' . taginfo.name, 'c', line('.')) endif normal! zv