tpope / vim-rails

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

gf doesn't work for partials for me? #602

Open thomaswitt opened 6 months ago

thomaswitt commented 6 months ago

Hi everybody,

I have a strange thing, gf works fine for me e.g. when in a Controller, it jumps to the model, when I have a partial, it jumps to the partial.

But when I render something from layout, it doesnt work: <%= render 'layouts/search' %>

gf on layouts/search doesn't work. All I get is E345: Can't fnd file "layouts/search" in path …

Yes, I have seen other issues and therefore it should be working but I don't know why it doesn't. Any idea?

thewatts commented 6 months ago

Mine is doing this too, after switching to using LazyVim and updating my config to use lua.

:) I'm still working on figuring it out - but I'll update this here if I have any luck

thewatts commented 6 months ago

Update: It looks like nvim-treesitter is causing things to break on my end.

If I disable it, gf starts working again.

awortham commented 5 months ago

Agreed -> nvim-treesitter seems to break the gf command to go find partials. Is there a way to give vim-rails command precedence? I'm assuming something in tree-sitter must also be relying on that same command.

thewatts commented 4 months ago

Potentially related: https://github.com/nvim-treesitter/nvim-treesitter/issues/6187

natematykiewicz commented 4 months ago

My gf couldn't find partials either. After adding additional_vim_regex_highlighting = true, to my treesitter config per this comment, gf works as expected.