aboutsummaryrefslogtreecommitdiffstats
path: root/autoload
diff options
context:
space:
mode:
Diffstat (limited to 'autoload')
-rw-r--r--autoload/xolox/misc/compat.vim2
-rw-r--r--autoload/xolox/misc/path.vim29
2 files changed, 14 insertions, 17 deletions
diff --git a/autoload/xolox/misc/compat.vim b/autoload/xolox/misc/compat.vim
index 56aff62..84f0a5f 100644
--- a/autoload/xolox/misc/compat.vim
+++ b/autoload/xolox/misc/compat.vim
@@ -7,7 +7,7 @@
" scripts breaks backwards compatibility. This enables my Vim plug-ins to fail
" early when they detect an incompatible version, instead of breaking at the
" worst possible moments :-).
-let g:xolox#misc#compat#version = 5
+let g:xolox#misc#compat#version = 6
" Remember the directory where the miscellaneous scripts are loaded from
" so the user knows which plug-in to update if incompatibilities arise.
diff --git a/autoload/xolox/misc/path.vim b/autoload/xolox/misc/path.vim
index 6ad8be4..60d3cbb 100644
--- a/autoload/xolox/misc/path.vim
+++ b/autoload/xolox/misc/path.vim
@@ -1,6 +1,6 @@
" Vim auto-load script
" Author: Peter Odding <peter@peterodding.com>
-" Last Change: April 28, 2013
+" Last Change: May 19, 2013
" URL: http://peterodding.com/code/vim/misc/
let s:windows_compatible = has('win32') || has('win64')
@@ -11,21 +11,18 @@ function! xolox#misc#path#which(...) " {{{1
let extensions = s:windows_compatible ? split($PATHEXT, ';') : ['']
let matches = []
let checked = {}
- for directory in split($PATH, s:windows_compatible ? ';' : ':')
- let directory = xolox#misc#path#absolute(directory)
- if !has_key(checked, directory)
- if isdirectory(directory)
- for program in a:000
- for extension in extensions
- let path = xolox#misc#path#merge(directory, program . extension)
- if executable(path)
- call add(matches, path)
- endif
- endfor
- endfor
- endif
- let checked[directory] = 1
- endif
+ for program in a:000
+ for extension in extensions
+ for directory in split($PATH, s:windows_compatible ? ';' : ':')
+ let directory = xolox#misc#path#absolute(directory)
+ if isdirectory(directory)
+ let path = xolox#misc#path#merge(directory, program . extension)
+ if executable(path)
+ call add(matches, path)
+ endif
+ endif
+ endfor
+ endfor
endfor
return matches
endfunction