Skip to content

Commit

Permalink
Fix gf on render :template/:action
Browse files Browse the repository at this point in the history
Resolves #181.
  • Loading branch information
tpope committed Sep 18, 2012
1 parent 9fb06f5 commit 2d65581
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions autoload/rails.vim
Original file line number Diff line number Diff line change
Expand Up @@ -1943,19 +1943,19 @@ function! s:RailsFind()
if res != ""|return res|endif

let res = s:findasymbol('action','\1')
if res != ""|return res|endif
if res != ""|return s:findview(res)|endif

let res = s:findasymbol('template','app/views/\1')
if res != ""|return res|endif
let res = s:findasymbol('template','\1')
if res != ""|return s:findview(res)|endif

let res = s:sub(s:sub(s:findasymbol('partial','\1'),'^/',''),'[^/]+$','_&')
if res != ""|return res."\n".s:findview(res)|endif

let res = s:sub(s:sub(s:findfromview('render\s*(\=\s*\%(:partial\s\+=>\|partial:\)\s*','\1'),'^/',''),'[^/]+$','_&')
if res != ""|return res."\n".s:findview(res)|endif

let res = s:findamethod('render\>\s*\%(:\%(template\|action\)\s\+=>\|template:\|action:\)\s*','\1.'.format.'\n\1')
if res != ""|return res|endif
let res = s:findamethod('render\>\s*\%(:\%(template\|action\)\s\+=>\|template:\|action:\)\s*','\1')
if res != ""|return s:findview(res)|endif

let res = s:sub(s:findfromview('render','\1'),'^/','')
if !buffer.type_name('controller', 'mailer')
Expand Down

0 comments on commit 2d65581

Please sign in to comment.