Conflict with ruby.vim on Windows

  1. Joel Elkins

    I am using vim 7.3.289 (built with ruby 1.8.7) vim with Command-T 1.3 on windows. Command T is quite stable and works well in general. However, the following error appears when opening a .rb file from CommandT browser. Aside from the error message, the file opens and edits just fine. (I also pulled the latest git of ruby.vim (f265e6b) with same result.)

    If this is a duplicate report, I apologize.

    Error detected while processing C:\Users\jelkins\vimfiles\bundle\vim-ruby-vim-ruby-f265e6b\ftplugin\ruby.vim:
    line   71:
    NoMethodError: undefined method `command' for CommandT::VIM:Module
    line   94:
    E121: Undefined variable: s:ruby_path
    E15: Invalid expression: s:ruby_path
    line   71:
    NoMethodError: undefined method `command' for CommandT::VIM:Module
    line   94:
    E121: Undefined variable: s:ruby_path
    E15: Invalid expression: s:ruby_path
    

    It appears to be caused by this section in ftplugin/ruby.vim

      elseif has("ruby") && has("win32")
        ruby VIM::command( 'let s:ruby_path = "%s"' % ($: + begin; require %q{rubygems}; Gem.all_load_paths.sort.uniq; rescue LoadError; []; end).join(%q{,}) )
        let s:ruby_path = '.,' . substitute(s:ruby_path, '\%(^\|,\)\.\%(,\|$\)', ',,', '')
    
  2. Greg Hurrell

    See ticket #1752. I think I might end up defining a command method on CommandT::VIM just to silence this.

  3. Joel Elkins

    I submitted a pull request to vim-ruby with the fix identified by others (and confirmed to work for me), which is to invoke ::VIM::command rather than VIM::command in ftplugin/ruby.vim. We'll see if they agree.

  4. Greg Hurrell

    Nice, we can hope. In the meantime, makes sense for me to implement the workaround mentioned above.

  5. Joel Elkins

    Sounds like a good plan, thanks!

  6. Joel Elkins

    Patch was merged upstream, FYI

  7. Greg Hurrell

    Nice!

Reply

This topic is now closed.