views:

26

answers:

1

I'm editing Ruby code in Vim. There is a failure in the Ruby.vim indentation which is bugging me.

Here is a block of code with correct indentation:

text.scan(/#/).each do |match|
    line1
    line2
end

Here is how Ruby.vim indents the code:

text.scan(/#/).each do |match|
    line1
line2
end

All lines subsequent to line2 are indented to the same level as line2.

The issue is caused by the hash (# usually means single line comment) symbol's presence in the regex.

Is anyone able to fix this in Ruby.vim and post the fix here? The problem is still present in the latest ruby.vim source on github, as linked to by Derick below.

Many thanks.

A: 

You can get the most up to date version of the ruby vim files from github:

http://github.com/vim-ruby/vim-ruby

i'm not sure if this will fix your problem or not... i haven't updated my ruby vim files in some time. but at least a patch can be submitted here, if it's not fixed. :)

Derick Bailey
Thanks Derick, I wasn't aware that there were more recent files there. However, I have tried the files and the problem is still present.Anyone clued-up on .vim syntax able to offer remedial assistance? Would be really great to fix this.
KomodoDave