Permalink
Browse files

Fix potential namespace collsion in ftplugin/ruby.vim

On win32 installs with +ruby, ftplugin/ruby.vim makes a call to
VIM::command to set the s:ruby_paths variable. In some circumstances,
this code can run when under a different ruby module, and if that ruby
module has a VIM module defined, there is a namespace clash. The fix is
to change the call to be ::VIM::command, which works fine under all
cases. The conflict occurs with Command-T in particular when opening
a .rb file from that tool.
  • Loading branch information...
1 parent f265e6b commit a20098a4844069106c71643ad4f5682707966d85 @jdelkins committed Nov 30, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 ftplugin/ruby.vim
View
@@ -68,7 +68,7 @@ if !exists("s:ruby_path")
let s:ruby_path = type(g:ruby_path) == type([]) ? join(g:ruby_path,',') : g:ruby_path
else
if has("ruby") && has("win32")
- ruby VIM::command( 'let s:ruby_paths = split("%s",",")' % $:.join(%q{,}) )
+ ruby ::VIM::command( 'let s:ruby_paths = split("%s",",")' % $:.join(%q{,}) )
elseif executable('ruby')
let s:code = "print $:.join(%q{,})"
if executable('env') && $PATH !~# '\s'

0 comments on commit a20098a

Please sign in to comment.