mirror of
https://github.com/preservim/tagbar.git
synced 2025-02-13 02:14:59 +08:00
Handle unloaded buffers when getting prototype, closes #222
This commit is contained in:
parent
76f16f891b
commit
b54d8d64f1
|
@ -1394,8 +1394,9 @@ 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
|
||||
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', '')
|
||||
endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user