aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Odding <peter@peterodding.com>2013-05-19 23:44:55 +0200
committerPeter Odding <peter@peterodding.com>2013-05-19 23:44:55 +0200
commit2cad05a933ade05c8540f787f0bd7d5e76ae5db2 (patch)
tree7a9fef6fff09c3d375c9fca307e9f7cb31aa742e
parentef2006272479307f86e45a93b55fee4c0f798580 (diff)
downloadvim-easytags-2cad05a933ade05c8540f787f0bd7d5e76ae5db2.tar.gz
Bug fix: Correct wrong expansion order in xolox#misc#path#which()
-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