mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 12:27:24 +00:00
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
67c951df4c
Co-authored-by: Anton Sharonov <anton.sharonov@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user