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

Return pattern for prototype if linenr is not available, closes #219

This commit is contained in:
Jan Larres
2014-10-11 18:37:21 +13:00
parent 4e5e0ebe59
commit 76f16f891b

View File

@@ -1394,6 +1394,11 @@ function! s:NormalTag.getPrototype(short) abort dict
else
let bufnr = self.fileinfo.bufnr
if self.fields.line == 0
" No linenumber available, try the pattern instead
return substitute(self.pattern, '^\\V\\^\\C\s*\(.*\)\\$$', '\1', '')
endif
let line = getbufline(bufnr, self.fields.line)[0]
let list = split(line, '\zs')