From 7e8533fceefb4358444997bf3deda8c1812069c7 Mon Sep 17 00:00:00 2001 From: Peter Odding Date: Mon, 9 Aug 2010 20:40:42 +0200 Subject: 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 :-) --- easytags.vim | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'easytags.vim') 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 -- cgit v1.2.3