aboutsummaryrefslogtreecommitdiffstats
path: root/easytags.vim
diff options
context:
space:
mode:
authorPeter Odding <peter@peterodding.com>2010-08-09 20:40:42 +0200
committerPeter Odding <peter@peterodding.com>2010-08-09 20:40:42 +0200
commit7e8533fceefb4358444997bf3deda8c1812069c7 (patch)
tree9be7495691f3b5d616431548b43af2721dfc151a /easytags.vim
parent89f9205ff840329aa75166249a99b1d0f227d661 (diff)
downloadvim-easytags-7e8533fceefb4358444997bf3deda8c1812069c7.tar.gz
Automatic/optional integration with shell.vim
I developed (parts of) my shell.vim plug-in after noticing the annoying command prompt windows that pop up temporarily on Windows when the easytags plug-in runs ctags. Because the shell.vim plug-in was a proof of concept I hadn't published any integration between the two plug-ins. Since then I've had several requests for this so here it is :-)
Diffstat (limited to 'easytags.vim')
-rw-r--r--easytags.vim13
1 files changed, 12 insertions, 1 deletions
diff --git a/easytags.vim b/easytags.vim
index 22845fb..79f56e9 100644
--- a/easytags.vim
+++ b/easytags.vim
@@ -64,7 +64,18 @@ function! s:CheckCtags(name, version)
" This function makes sure it is because the easytags plug-in requires the
" --list-languages option.
if executable(a:name)
- let listing = system(a:name . ' --version')
+ let command = a:name . ' --version'
+ try
+ let listing = join(xolox#shell#execute(command, 1), '\n')
+ catch /^Vim\%((\a\+)\)\=:E117/
+ " Ignore missing shell.vim plug-in.
+ let listing = system(command)
+ catch
+ " xolox#shell#execute() converts shell errors to exceptions and since
+ " we're checking whether one of several executables exists we don't want
+ " to throw an error when the first one doesn't!
+ return
+ endtry
let pattern = 'Exuberant Ctags \zs\d\+\(\.\d\+\)*'
let g:easytags_ctags_version = matchstr(listing, pattern)
return s:VersionToNumber(g:easytags_ctags_version) >= a:version