File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -291,10 +291,14 @@ endfunction
291291
292292function ! s: gf (count ,map ,edit) abort
293293 let target = expand (' <cfile>' )
294- if target == # ' require_relative ' && getline (' .' ) = ~# ' ^\s*require_relative\s*\(["'' ]\).*\1'
294+ if target == # ' ^require ' && getline (' .' ) = ~# ' ^\s*require_relative\s*\(["'' ]\).*\1'
295295 let target = matchstr (getline (' .' ),' \(["'' ]\)\zs.\{-\}\ze\1' )
296296 return a: edit .' %:h/' .target.' .rb'
297297 endif
298+ if target = ~# ' ^\%(require\|load\|autoload\)$' && getline (' .' ) = ~# ' ^\s*\%(require \|load \|autoload :\w\+,\)\s*\|^\s*require(\=\s*File\.expand_path(\(["'' ]\)\.\./.*\1,\s*__FILE__)'
299+ let target = matchstr (getline (' .' ),' \(["'' ]\)\.\./\zs.\{-\}\ze\1' )
300+ return a: edit .' %:h/' .target.' .rb'
301+ endif
298302 if target = ~# ' ^\%(require\|load\|autoload\)$' && getline (' .' ) = ~# ' ^\s*\%(require \|load \|autoload :\w\+,\)\s*\(["'' ]\).*\1'
299303 let target = matchstr (getline (' .' ),' \(["'' ]\)\zs.\{-\}\ze\1' )
300304 endif
You can’t perform that action at this time.
0 commit comments