diff options
author | Christian Clason <c.clason@uni-graz.at> | 2023-09-06 23:49:58 +0200 |
---|---|---|
committer | Christian Clason <c.clason@uni-graz.at> | 2023-09-07 09:06:35 +0200 |
commit | 5d1c1da3c90adece96f491e7f12fd76c03a881c9 (patch) | |
tree | 70e8b814aa7c571a73e21245f848e0dcde0270e5 /runtime/ftplugin/ruby.vim | |
parent | d27214331815324ea5762b5aa22996b9019085c6 (diff) | |
download | rneovim-5d1c1da3c90adece96f491e7f12fd76c03a881c9.tar.gz rneovim-5d1c1da3c90adece96f491e7f12fd76c03a881c9.tar.bz2 rneovim-5d1c1da3c90adece96f491e7f12fd76c03a881c9.zip |
vim-patch:67c951df4c95
runtime(ftplugin): allow to exec if curdir is in PATH
In case the current directory is present as valid $PATH entry, it is OK
to call the program from it, even if vim curdir is in that same
directory.
(Without that patch, for instance, you will not be able to open .zip
files while your current directory is /bin)
closes: vim/vim#13027
https://github.com/vim/vim/commit/67c951df4c95981c716eeedb1b102d9668549e65
Co-authored-by: Anton Sharonov <anton.sharonov@gmail.com>
Diffstat (limited to 'runtime/ftplugin/ruby.vim')
-rw-r--r-- | runtime/ftplugin/ruby.vim | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/runtime/ftplugin/ruby.vim b/runtime/ftplugin/ruby.vim index daffe1e0dc..a424801cd1 100644 --- a/runtime/ftplugin/ruby.vim +++ b/runtime/ftplugin/ruby.vim @@ -77,11 +77,14 @@ function! s:query_path(root) abort let cwd = fnameescape(getcwd()) try exe cd fnameescape(a:root) - if fnamemodify(exepath('ruby'), ':p:h') ==# cwd + let s:tmp_cwd = getcwd() + if (fnamemodify(exepath('ruby'), ':p:h') ==# cwd + \ && (index(split($PATH,has("win32")? ';' : ':'), s:tmp_cwd) == -1 || s:tmp_cwd == '.')) let path = [] else let path = split(system(path_check),',') endif + unlet s:tmp_cwd exe cd cwd return path finally |