Permalink
Browse files

Merge pull request #25 from magicdrive/pullrequest

s:functions cache
  • Loading branch information...
2 parents cdce2c0 + 4508f3b commit 8fb7b5f1ff73309d4f3eb775ee3bc0570de7d963 @thinca thinca committed Oct 7, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 autoload/ref/perldoc.vim
View
@@ -97,10 +97,14 @@ function! s:source.get_keyword()
return kwd
endfunction
+let s:functions = []
function! s:source.normalize(query)
let query = a:query
if g:ref_perldoc_auto_append_f && query =~# '^[a-z]\+$'
- if index(s:func_list(''), query) !=# -1
+ if empty(s:functions)
+ let s:functions = s:func_list('')
+ endif
+ if index(s:functions, query) !=# -1
" lower case, match function name, assume it to be built-in function
let query = '-f ' . query
endif

0 comments on commit 8fb7b5f

Please sign in to comment.