Skip to content

Commit 4a6439d

Browse files
committed
Apply @rogeruiz's patch for Universal Ctags and maintain in fork
xolox#133
1 parent 72a8753 commit 4a6439d

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

autoload/xolox/easytags.vim

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -78,19 +78,25 @@ function! xolox#easytags#check_ctags_compatible(name, min_version) " {{{2
7878
call xolox#misc#msg#debug("easytags.vim %s: Command '%s' returned nonzero exit code %i!", g:xolox#easytags#version, a:name, result['exit_code'])
7979
else
8080
" Extract the version number from the output.
81-
let pattern = '\(Exuberant\|Universal\) Ctags \zs\(\d\+\(\.\d\+\)*\|Development\)'
82-
let g:easytags_ctags_version = matchstr(get(result['stdout'], 0, ''), pattern)
83-
" Deal with development builds.
84-
if g:easytags_ctags_version == 'Development'
85-
call xolox#misc#msg#debug("easytags.vim %s: Assuming development build is compatible ..", g:xolox#easytags#version, a:name)
86-
return 1
87-
endif
88-
" Make sure the version is compatible.
89-
if xolox#misc#version#at_least(a:min_version, g:easytags_ctags_version)
90-
call xolox#misc#msg#debug("easytags.vim %s: Version is compatible! :-)", g:xolox#easytags#version)
91-
return 1
92-
else
93-
call xolox#misc#msg#debug("easytags.vim %s: Version is not compatible! :-(", g:xolox#easytags#version)
81+
let pattern = '\(\w\+\) Ctags \(\d\+\(\.\d\+\)*\|Development\)'
82+
let match = matchlist(get(result['stdout'], 0, ''), pattern)
83+
let g:easytags_ctags_fork = match[1]
84+
let g:easytags_ctags_version = match[2]
85+
if g:easytags_ctags_fork != '' && g:easytags_ctags_version != ''
86+
call xolox#misc#msg#debug("easytags.vim %s: Detected %s Ctags %s", g:xolox#easytags#version, g:easytags_ctags_fork, g:easytags_ctags_version)
87+
if g:easytags_ctags_fork == 'Universal'
88+
" All versions should be compatible.
89+
call xolox#misc#msg#debug("easytags.vim %s: Assuming all versions is compatible ..", g:xolox#easytags#version)
90+
return 1
91+
elseif g:easytags_ctags_fork == 'Exuberant'
92+
" Make sure the version is compatible.
93+
if xolox#misc#version#at_least(a:min_version, g:easytags_ctags_version)
94+
call xolox#misc#msg#debug("easytags.vim %s: Version is compatible! :-)", g:xolox#easytags#version)
95+
return 1
96+
else
97+
call xolox#misc#msg#debug("easytags.vim %s: Version is not compatible! :-(", g:xolox#easytags#version)
98+
endif
99+
endif
94100
endif
95101
endif
96102
call xolox#misc#msg#debug("easytags.vim %s: Standard output of command: %s", g:xolox#easytags#version, string(result['stdout']))

0 commit comments

Comments
 (0)