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:
@@ -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')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user