开发者

Ruby.vim indent fails with each..do leading with regex containing a hash ('#')

开发者 https://www.devze.com 2023-01-22 14:37 出处:网络
I\'m editi开发者_运维技巧ng Ruby code in Vim. There is a failure in the Ruby.vim indentation which is bugging me.

I'm editi开发者_运维技巧ng 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.


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. :)

0

精彩评论

暂无评论...
验证码 换一张
取 消