Skip to content

Commit

Permalink
Fix potential namespace collsion in ftplugin/ruby.vim
Browse files Browse the repository at this point in the history
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
jdelkins committed Nov 30, 2011
1 parent f265e6b commit a20098a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ftplugin/ruby.vim
Expand Up @@ -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'
Expand Down

0 comments on commit a20098a

Please sign in to comment.