Skip to content

Commit 1ea8e08

Browse files
committed
Cheat gf on autoload
1 parent cb5b5b2 commit 1ea8e08

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ftplugin/ruby.vim

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,9 @@ endfunction
256256

257257
function! s:gf(count,map,edit) abort
258258
let target = expand('<cfile>')
259-
if target =~# '^\%(require\|load\)$' && getline('.') =~# '^\s*\%(require\|load\) \(["'']\).*\1'
260-
let target = matchstr(getline('.'),'^\s*\%(require\|load\) \(["'']\)\zs.\{-\}\ze\1')
259+
if target =~# '^\%(require\|load\|autoload\)$' && getline('.') =~# '^\s*\%(require \|load \|autoload :\w\+,\)\s*\(["'']\).*\1'
260+
let target = matchstr(getline('.'),'\(["'']\)\zs.\{-\}\ze\1')
261+
let g:target = target
261262
endif
262263
let found = findfile(target, &path, a:count)
263264
if found ==# ''

0 commit comments

Comments
 (0)