tpope / vim-rails

rails.vim: Ruby on Rails power tools
http://www.vim.org/scripts/script.php?script_id=1567
4.1k stars 383 forks source link

gf command does not look for .html.erb extension when used on collection variables #586

Closed kulbirsaini closed 2 years ago

kulbirsaini commented 2 years ago

Vim: 8.1.2269 Vim Rails: 9c92dafe6894aed3fa81df7ac52cdd8e7a8ea9a6 [May 05, 2022] Ruby: 3.1.2 Rails: 7.0.2

As per title, the gf commands works fine everywhere except when you are on the instance collection variables. In that case, it somehow does not look up for .html.erb extension. A screenshot is attached.

vim-rails-bug

tpope commented 2 years ago

'suffixesadd' takes care of .erb. The problem is _industries vs _industry.

kulbirsaini commented 2 years ago

Ah! You are right. The plugin is not able to handle collection renders. Tried with another controller <%= render @sectors %> and same issue. I am not sure if this is something that the plugin can handle in future. I updated the title and text in the original bug report.