eschulte/rinari

rinari-find-by-context does nothing

paulogeyer opened this issue · 7 comments

Hi,

I don't know if I am missing something, but rinari-find-by-conext doesn't work

I've installed it from the emacs package.el, and looks like I'm using the newest version, my emacs version is 24-snapshot

Can you please provide a snippet of the view code in which you are executing the command, with an indication of where you cursor is when you do so?

-Steve

I'd second this.

Example:

In controllers:
If you're on a model name, it does nothing.
If you're on a layout name it does nothing.

In the view:
If you're on a render line, it does nothing.

I don't really know what this function was designed to do.

I'm thinking it should probably just be removed.

Well it would be nice to have something like vim's gf which does find by context and it's very handy.

I assume that's bound to something Rails-specific in that case? Can you point me at the corresponding vimscript?

Yes it's from the rails.vim plugin https://github.com/tpope/vim-rails (which is awesome).

asok commented

It might be dump at start. So if we are in the line with a word "render" look for partial or template. if there is a "belongs_to", "has_one", "has_many" singularize the word under the point and look for a model. Any other case call find-tag with the word under the point as an argument. I have something similar that is a half-buggy code here: https://github.com/asok/arm/blob/master/arm.el#L265