1
0
mirror of https://github.com/gryf/tagbar.git synced 2025-12-17 19:40:27 +01:00

Fix Python member functions with Universal Ctags, closes #306

This commit is contained in:
Jan Larres
2016-09-10 20:57:37 +12:00
parent 7b36c46d17
commit 35ee5a91f9

View File

@@ -55,6 +55,7 @@ let s:statusline_in_use = 0
" 0: not checked yet; 1: checked and found; 2: checked and not found
let s:checked_ctags = 0
let s:checked_ctags_types = 0
let s:ctags_is_uctags = 0
let s:ctags_types = {}
let s:new_window = 1
@@ -565,6 +566,12 @@ function! s:InitTypes() abort
\ 'class' : 'c',
\ 'function' : 'f'
\ }
if s:ctags_is_uctags
" Universal Ctags treats member functions differently from normal
" functions
let type_python.kind2scope.m = 'member'
let type_python.scope2kind.member = 'm'
endif
let s:known_types.python = type_python
let s:known_types.pyrex = type_python
let s:known_types.cython = type_python
@@ -1143,13 +1150,14 @@ endfunction
function! s:CheckExCtagsVersion(output) abort
call s:debug('Checking Exuberant Ctags version')
if a:output =~ 'Exuberant Ctags Development'
call s:debug("Found development version, assuming compatibility")
if a:output =~ 'Universal Ctags'
call s:debug("Found Universal Ctags, assuming compatibility")
let s:ctags_is_uctags = 1
return 1
endif
if a:output =~ 'Universal Ctags'
call s:debug("Found Universal Ctags, assuming compatibility")
if a:output =~ 'Exuberant Ctags Development'
call s:debug("Found development version, assuming compatibility")
return 1
endif