aboutsummaryrefslogtreecommitdiffstats
path: root/autoload/xolox
diff options
context:
space:
mode:
authorPeter Odding <peter@peterodding.com>2013-09-01 12:00:03 +0200
committerPeter Odding <peter@peterodding.com>2013-09-01 12:00:03 +0200
commit9713f0a284921dc9782ae1c24dae03ce0c3f9901 (patch)
tree80ae36149f0f5743c65ae2c9737f123922070f1c /autoload/xolox
parent330ec57f84b46268ef5b5ddb21ec2d9a660750d2 (diff)
downloadvim-easytags-9713f0a284921dc9782ae1c24dae03ce0c3f9901.tar.gz
Bug fix: Support for disabled languages in Exuberant Ctags (issue #62)
See issue #62 on GitHub: https://github.com/xolox/vim-easytags/issues/62
Diffstat (limited to 'autoload/xolox')
-rw-r--r--autoload/xolox/easytags.vim24
1 files changed, 13 insertions, 11 deletions
diff --git a/autoload/xolox/easytags.vim b/autoload/xolox/easytags.vim
index e201f70..b639bbf 100644
--- a/autoload/xolox/easytags.vim
+++ b/autoload/xolox/easytags.vim
@@ -1,9 +1,9 @@
" Vim script
" Author: Peter Odding <peter@peterodding.com>
-" Last Change: August 31, 2013
+" Last Change: September 1, 2013
" URL: http://peterodding.com/code/vim/easytags/
-let g:xolox#easytags#version = '3.4.2'
+let g:xolox#easytags#version = '3.4.3'
" Plug-in initialization. {{{1
@@ -566,21 +566,23 @@ function! xolox#easytags#supported_filetypes() " {{{2
let command = g:easytags_cmd . ' --list-languages'
let listing = xolox#misc#os#exec({'command': command})['stdout']
endif
- let s:supported_filetypes = map(copy(listing) + keys(xolox#misc#option#get('easytags_languages', {})), 's:check_filetype(listing, v:val)')
+ let s:supported_filetypes = keys(xolox#misc#option#get('easytags_languages', {}))
+ for line in listing
+ if line =~ '\[disabled\]$'
+ " Ignore languages that have been explicitly disabled using `--languages=-Vim'.
+ continue
+ elseif line =~ '^\w\S*$'
+ call add(s:supported_filetypes, xolox#easytags#to_vim_ft(line))
+ elseif line =~ '\S'
+ call xolox#misc#msg#warn("easytags.vim %s: Failed to parse line of output from ctags --list-languages: %s", g:xolox#easytags#version, string(line))
+ endif
+ endfor
let msg = "easytags.vim %s: Retrieved %i supported languages in %s."
call xolox#misc#timer#stop(msg, g:xolox#easytags#version, len(s:supported_filetypes), starttime)
endif
return s:supported_filetypes
endfunction
-function! s:check_filetype(listing, cline)
- if a:cline !~ '^\w\S*$'
- let msg = "Failed to get supported languages! (output: %s)"
- throw printf(msg, strtrans(join(a:listing, "\n")))
- endif
- return xolox#easytags#to_vim_ft(a:cline)
-endfunction
-
function! xolox#easytags#select_supported_filetypes(vim_ft) " {{{2
let supported_filetypes = xolox#easytags#supported_filetypes()
let applicable_filetypes = []