mirror of
https://github.com/gryf/tagbar.git
synced 2025-12-18 03:50:26 +01:00
Fix bug with files with empty filetype
This commit is contained in:
@@ -2305,23 +2305,23 @@ function! s:AutoUpdate(fname)
|
||||
return
|
||||
endif
|
||||
|
||||
" Only consider the main filetype in cases like 'python.django'
|
||||
let filetype = split(&filetype, '\.')[0]
|
||||
|
||||
" Don't do anything if the file isn't supported
|
||||
if !s:IsValidFile(a:fname, filetype)
|
||||
if !s:IsValidFile(a:fname, &filetype)
|
||||
return
|
||||
endif
|
||||
|
||||
" Only consider the main filetype in cases like 'python.django'
|
||||
let ftype = split(&filetype, '\.')[0]
|
||||
|
||||
" Process the file if it's unknown or the information is outdated
|
||||
" Also test for entries that exist but are empty, which will be the case
|
||||
" if there was an error during the ctags execution
|
||||
if s:known_files.has(a:fname) && !empty(s:known_files.get(a:fname))
|
||||
if s:known_files.get(a:fname).mtime != getftime(a:fname)
|
||||
call s:ProcessFile(a:fname, filetype)
|
||||
call s:ProcessFile(a:fname, ftype)
|
||||
endif
|
||||
elseif !s:known_files.has(a:fname)
|
||||
call s:ProcessFile(a:fname, filetype)
|
||||
call s:ProcessFile(a:fname, ftype)
|
||||
endif
|
||||
|
||||
let fileinfo = s:known_files.get(a:fname)
|
||||
|
||||
Reference in New Issue
Block a user