Skip to content

Commit a20098a

Browse files
committed
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.
1 parent f265e6b commit a20098a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ftplugin/ruby.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ if !exists("s:ruby_path")
6868
let s:ruby_path = type(g:ruby_path) == type([]) ? join(g:ruby_path,',') : g:ruby_path
6969
else
7070
if has("ruby") && has("win32")
71-
ruby VIM::command( 'let s:ruby_paths = split("%s",",")' % $:.join(%q{,}) )
71+
ruby ::VIM::command( 'let s:ruby_paths = split("%s",",")' % $:.join(%q{,}) )
7272
elseif executable('ruby')
7373
let s:code = "print $:.join(%q{,})"
7474
if executable('env') && $PATH !~# '\s'

0 commit comments

Comments
 (0)