mirror of
https://github.com/gryf/tagbar.git
synced 2026-10-07 06:00:39 +02:00
Handle unloaded buffers when getting prototype, closes #222
This commit is contained in:
1 parent
76f16f891b
commit
b54d8d64f1
1 file changed
+3
-2
+3
-2
@@ -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
|
||||
|
||||
|
||||
Reference in new issue
Block a user