File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -290,17 +290,16 @@ function! RubyCursorIdentifier()
290290endfunction
291291
292292function ! s: gf (count ,map ,edit) abort
293- let target = expand (' <cfile>' )
294- if target == # ' ^require' && getline (' .' ) = ~# ' ^\s*require_relative\s*\(["'' ]\).*\1'
293+ if getline (' .' ) = ~# ' ^\s*require_relative\s*\(["'' ]\).*\1\s*$'
295294 let target = matchstr (getline (' .' ),' \(["'' ]\)\zs.\{-\}\ze\1' )
296295 return a: edit .' %:h/' .target.' .rb'
297- endif
298- if target = ~# ' ^\%(require\|load\|autoload\)$' && getline (' .' ) = ~# ' ^\s*\%(require \|load \|autoload :\w\+,\)\s*\|^\s*require(\=\s*File\.expand_path(\(["'' ]\)\.\./.*\1,\s*__FILE__)'
296+ elseif getline (' .' ) = ~# ' ^\s*\%(require \|load \|autoload :\w\+,\)\s*\|^\s*require(\=\s*File\.expand_path(\(["'' ]\)\.\./.*\1,\s*__FILE__)\s*$'
299297 let target = matchstr (getline (' .' ),' \(["'' ]\)\.\./\zs.\{-\}\ze\1' )
300298 return a: edit .' %:h/' .target.' .rb'
301- endif
302- if target = ~# ' ^\%(require\|load\|autoload\)$' && getline (' .' ) = ~# ' ^\s*\%(require \|load \|autoload :\w\+,\)\s*\(["'' ]\).*\1'
299+ elseif getline (' .' ) = ~# ' ^\s*\%(require \|load \|autoload :\w\+,\)\s*\(["'' ]\).*\1\s*$'
303300 let target = matchstr (getline (' .' ),' \(["'' ]\)\zs.\{-\}\ze\1' )
301+ else
302+ let target = expand (' <cfile>' )
304303 endif
305304 let found = findfile (target, &path , a: count )
306305 if found == # ' '
You can’t perform that action at this time.
0 commit comments