Skip to content

Commit

Permalink
Merge pull request thinca#25 from magicdrive/pullrequest
Browse files Browse the repository at this point in the history
s:functions cache
  • Loading branch information
thinca committed Oct 7, 2012
2 parents cdce2c0 + 4508f3b commit 8fb7b5f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion autoload/ref/perldoc.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8fb7b5f

Please sign in to comment.