Permalink
Browse files

Cheat gf on autoload

  • Loading branch information...
1 parent cb5b5b2 commit 1ea8e08d6ade3832965589c69ec73450e2ddbb81 @tpope tpope committed Aug 23, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 ftplugin/ruby.vim
View
@@ -256,8 +256,9 @@ endfunction
function! s:gf(count,map,edit) abort
let target = expand('<cfile>')
- if target =~# '^\%(require\|load\)$' && getline('.') =~# '^\s*\%(require\|load\) \(["'']\).*\1'
- let target = matchstr(getline('.'),'^\s*\%(require\|load\) \(["'']\)\zs.\{-\}\ze\1')
+ if target =~# '^\%(require\|load\|autoload\)$' && getline('.') =~# '^\s*\%(require \|load \|autoload :\w\+,\)\s*\(["'']\).*\1'
+ let target = matchstr(getline('.'),'\(["'']\)\zs.\{-\}\ze\1')
+ let g:target = target
endif
let found = findfile(target, &path, a:count)
if found ==# ''

0 comments on commit 1ea8e08

Please sign in to comment.