Skip to content

Commit c79a454

Browse files
committed
Support :: before File.expand_path in gf
1 parent a90ca0a commit c79a454

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ftplugin/ruby.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ function! s:gf(count,map,edit) abort
302302
if getline('.') =~# '^\s*require_relative\s*\(["'']\).*\1\s*$'
303303
let target = matchstr(getline('.'),'\(["'']\)\zs.\{-\}\ze\1')
304304
return a:edit.' %:h/'.target.'.rb'
305-
elseif getline('.') =~# '^\s*\%(require[( ]\|load[( ]\|autoload[( ]:\w\+,\)\s*\s*File\.expand_path(\(["'']\)\.\./.*\1,\s*__FILE__)\s*$'
305+
elseif getline('.') =~# '^\s*\%(require[( ]\|load[( ]\|autoload[( ]:\w\+,\)\s*\s*\%(::\)\=File\.expand_path(\(["'']\)\.\./.*\1,\s*__FILE__)\s*$'
306306
let target = matchstr(getline('.'),'\(["'']\)\.\./\zs.\{-\}\ze\1')
307307
return a:edit.' %:h/'.target.'.rb'
308308
elseif getline('.') =~# '^\s*\%(require \|load \|autoload :\w\+,\)\s*\(["'']\).*\1\s*$'

0 commit comments

Comments
 (0)