Tyru Exe wrote:

> Hi list.
> 
> Place these scripts in ~/.vim
> - autoload/mylib.vim
> - autoload/mylib2.vim
> 
> 
> --- autoload/mylib.vim ---
> 
> function! mylib#func()
>     echo 'mylib#func()'
>     echo exists('*mylib2#func')
> endfunction
> 
> 
> --- autoload/mylib2.vim ---
> 
> function! mylib2#func()
>     echo 'mylib2#func()'
> endfunction
> 
> 
> Run vim and type this.
> :call mylib#func()   " => 0
> 
> 
> And, exists() also returns bogus value at plugin/mylib.vim like this.
> 
> --- plugin/mylib.vim ---
> 
> function! MylibFunc()
>     echo 'MylibFunc()'
>     echo exists('*mylib2#func')
> endfunction
> 
> 
> :call MylibFunc()
> will also print "0".

This works as intended.  Autoload scripts are only loaded when used.
Not when you check if something defined in it exists.

-- 
   An extraordinary TALL KNIGHT in all black (possibly John with Mike on his
   shoulders) walks out from the dark trees.  He is extremely fierce and
   gruesome countenance.  He walks towards KING ARTHUR and PATSY, who are
   wazzing like mad.  (Salopian slang, meaning very scared.  almost to the
   point of wetting oneself, e.g. before an important football match or
   prior to a postering.  Salopian slang meaning a beating by the school
   praeposters.  Sorry about the Salopian slant to this stage direction - Ed.)
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui