From 41ee79fc0f7fba095cd43a8bde0a834305a16a84 Mon Sep 17 00:00:00 2001 From: Jan Larres Date: Thu, 15 Jun 2017 17:26:16 +1200 Subject: [PATCH] Escape tag search pattern with \M instead of \V This follows the Vim manual in |tag-search|, which says that searches are executed as if 'magic' was off. --- autoload/tagbar.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autoload/tagbar.vim b/autoload/tagbar.vim index 016f9e5..fde6f37 100644 --- a/autoload/tagbar.vim +++ b/autoload/tagbar.vim @@ -1563,7 +1563,7 @@ function! s:NormalTag.getPrototype(short) abort dict if self.fields.line == 0 || !bufloaded(bufnr) " No linenumber available or buffer not loaded (probably due to " 'nohidden'), try the pattern instead - return substitute(self.pattern, '^\\V\\^\\C\s*\(.*\)\\$$', '\1', '') + return substitute(self.pattern, '^\\M\\^\\C\s*\(.*\)\\$$', '\1', '') endif let line = getbufline(bufnr, self.fields.line)[0] @@ -2478,7 +2478,7 @@ function! s:ParseTagline(part1, part2, typeinfo, fileinfo) abort let dollar = '' endif let pattern = strpart(pattern, start, end - start) - let taginfo.pattern = '\V\^\C' . pattern . dollar + let taginfo.pattern = '\M\^\C' . pattern . dollar " When splitting fields make sure not to create empty keys or values in " case a value illegally contains tabs