Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Cheat gf on autoload

  • Loading branch information...
commit 1ea8e08d6ade3832965589c69ec73450e2ddbb81 1 parent cb5b5b2
@tpope tpope authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 ftplugin/ruby.vim
View
5 ftplugin/ruby.vim
@@ -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 ==# ''
Please sign in to comment.
Something went wrong with that request. Please try again.