File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -2457,6 +2457,20 @@ function! s:ruby_cfile() abort
24572457 endif
24582458 endif
24592459
2460+ let declpat = ' ^\(\s*\)\(\w\+\)\>\s*(\=\s*:\=\(['' "]\=\)\(\%(\w\|::\)\+\)\3'
2461+ let decl = matchlist (getline (' .' ), declpat)
2462+ if len (decl) && len (decl[0 ]) >= col (' .' )
2463+ let declid = synID (line (' .' ), 1 + len (decl[1 ]), 1 )
2464+ let declbase = rails#underscore (decl[4 ])
2465+ if declid == # hlID (' rubyEntities' )
2466+ return rails#singularize (declbase) . ' .rb'
2467+ elseif declid == # hlID (' rubyEntity' ) || decl[4 ] = ~# ' \u'
2468+ return declbase . ' .rb'
2469+ elseif index ([hlID (' rubyMacro' ), hlID (' rubyAttribute' )], declid) >= 0
2470+ return rails#singularize (declbase) . ' .rb'
2471+ endif
2472+ endif
2473+
24602474 let synid = synID (line (' .' ), col (' .' ), 1 )
24612475 let old_isfname = &isfname
24622476 try
You can’t perform that action at this time.
0 commit comments