diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2023-11-29 22:40:31 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2023-11-29 22:40:31 +0000 |
commit | 339e2d15cc26fe86988ea06468d912a46c8d6f29 (patch) | |
tree | a6167fc8fcfc6ae2dc102f57b2473858eac34063 /runtime/ftplugin/ruby.vim | |
parent | 067dc73729267c0262438a6fdd66e586f8496946 (diff) | |
parent | 4a8bf24ac690004aedf5540fa440e788459e5e34 (diff) | |
download | rneovim-339e2d15cc26fe86988ea06468d912a46c8d6f29.tar.gz rneovim-339e2d15cc26fe86988ea06468d912a46c8d6f29.tar.bz2 rneovim-339e2d15cc26fe86988ea06468d912a46c8d6f29.zip |
Merge remote-tracking branch 'upstream/master' into fix_repeatcmdline
Diffstat (limited to 'runtime/ftplugin/ruby.vim')
-rw-r--r-- | runtime/ftplugin/ruby.vim | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/runtime/ftplugin/ruby.vim b/runtime/ftplugin/ruby.vim index 8c1f47731c..b61c1765d9 100644 --- a/runtime/ftplugin/ruby.vim +++ b/runtime/ftplugin/ruby.vim @@ -3,7 +3,7 @@ " Maintainer: Tim Pope <vimNOSPAM@tpope.org> " URL: https://github.com/vim-ruby/vim-ruby " Release Coordinator: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2022 Mar 21 +" Last Change: 2023 Sep 1st if (exists("b:did_ftplugin")) finish @@ -61,6 +61,10 @@ if !exists('g:ruby_version_paths') endif function! s:query_path(root) abort + " Disabled by default for security reasons. + if !get(g:, 'ruby_exec', get(g:, 'plugin_exec', 0)) + return [] + endif let code = "print $:.join %q{,}" if &shell =~# 'sh' && empty(&shellxquote) let prefix = 'env PATH='.shellescape($PATH).' ' @@ -77,7 +81,14 @@ function! s:query_path(root) abort let cwd = fnameescape(getcwd()) try exe cd fnameescape(a:root) - let path = split(system(path_check),',') + 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 |