Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions autoload/tagbar.vim
Original file line number Diff line number Diff line change
Expand Up @@ -1397,6 +1397,12 @@ function! s:ExecuteCtagsOnFile(fname, realfname, typeinfo) abort
let ctags_args += [ '-V' ]
endif

" Define a new language before adding --language-force to the list of
" arguments
if has_key(a:typeinfo, 'deflang')
let ctags_args += ['--langdef=' . expand(a:typeinfo.deflang)]
endif
Comment on lines +1402 to +1404
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might be able to just key off the deffile instead. Then there wouldn't need to be any new config keys. Can you give this a try and see if this works?

Suggested change
if has_key(a:typeinfo, 'deflang')
let ctags_args += ['--langdef=' . expand(a:typeinfo.deflang)]
endif
if has_key(a:typeinfo, 'deffile')
let ctags_args += ['--langdef=' . a:typeinfo.ctagstype]
endif


" Third-party programs may not necessarily make use of this
if has_key(a:typeinfo, 'ctagstype')
let ctags_type = a:typeinfo.ctagstype
Expand Down