mirror of
https://github.com/preservim/tagbar.git
synced 2025-02-14 21:42:46 +08:00
Return pattern for prototype if linenr is not available, closes #219
This commit is contained in:
parent
4e5e0ebe59
commit
76f16f891b
|
@ -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')
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user