aboutsummaryrefslogtreecommitdiffstats
path: root/plugin
diff options
context:
space:
mode:
authorPeter Odding <peter@peterodding.com>2013-05-13 23:02:06 +0200
committerPeter Odding <peter@peterodding.com>2013-05-13 23:02:06 +0200
commit7c61b34c0a6c27e72ad68f46ef28586f14ffa4b3 (patch)
tree6fadd3951926fa9e67f067c88b04e1781ac7ae82 /plugin
parent9e8261a83ef5f3c1c9ed6e4a4c07ad7c7f139711 (diff)
parent9c88b0e71b41411735000645089670a3577f3e5d (diff)
downloadvim-easytags-7c61b34c0a6c27e72ad68f46ef28586f14ffa4b3.tar.gz
Updated miscellaneous scripts
Diffstat (limited to 'plugin')
-rw-r--r--plugin/easytags.vim40
1 files changed, 16 insertions, 24 deletions
diff --git a/plugin/easytags.vim b/plugin/easytags.vim
index 935ef40..64361a7 100644
--- a/plugin/easytags.vim
+++ b/plugin/easytags.vim
@@ -1,6 +1,6 @@
" Vim plug-in
" Author: Peter Odding <peter@peterodding.com>
-" Last Change: April 19, 2013
+" Last Change: May 13, 2013
" URL: http://peterodding.com/code/vim/easytags/
" Requires: Exuberant Ctags (http://ctags.sf.net)
@@ -58,12 +58,12 @@ function! s:InitEasyTags(version)
" FIXME The code below that searches the $PATH is not used on Windows at
" the moment because xolox#misc#path#which() generally produces absolute
" paths and on Windows these absolute paths tend to contain spaces which
- " makes xolox#shell#execute() fail. I've tried quoting the program name
- " with double quotes but it fails just the same (it works with system()
- " though). Anyway the problem of having multiple conflicting versions of
- " Exuberant Ctags installed is not that relevant to Windows since it
- " doesn't have a package management system. I still want to fix
- " xolox#shell#execute() though.
+ " makes xolox#shell#execute_with_dll() fail. I've tried quoting the
+ " program name with double quotes but it fails just the same (it works
+ " with system() though). Anyway the problem of having multiple conflicting
+ " versions of Exuberant Ctags installed is not that relevant to Windows
+ " since it doesn't have a package management system. I still want to fix
+ " xolox#shell#execute_with_dll() though.
if s:CheckCtags('ctags', a:version)
let g:easytags_cmd = 'ctags'
return 1
@@ -96,23 +96,15 @@ function! s:CheckCtags(name, version)
" --list-languages option (and more).
if executable(a:name)
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\+\)*\|Development\)'
- let g:easytags_ctags_version = matchstr(listing, pattern)
- if g:easytags_ctags_version == 'Development'
- return 1
- else
- return s:VersionToNumber(g:easytags_ctags_version) >= a:version
+ let result = xolox#misc#os#exec({'command': command, 'check': 0})
+ if result['exit_code'] == 0
+ let pattern = 'Exuberant Ctags \zs\(\d\+\(\.\d\+\)*\|Development\)'
+ let g:easytags_ctags_version = matchstr(result['stdout'][0], pattern)
+ if g:easytags_ctags_version == 'Development'
+ return 1
+ else
+ return s:VersionToNumber(g:easytags_ctags_version) >= a:version
+ endif
endif
endif
endfunction