ctrlpvim / ctrlp.vim

Active fork of kien/ctrlp.vim—Fuzzy file, buffer, mru, tag, etc finder.
ctrlpvim.github.com/ctrlp.vim
Other
5.58k stars 260 forks source link

ctrlp generates FuncUndefined event when started #612

Closed jelibabi closed 2 years ago

jelibabi commented 2 years ago

Hi, thanks for working on ctrlp, it is awesome :)

When ctrlp starts, this call sequence occurs in file ctrlp.vim/autoload/ctrlp.vim:

    ctrlp#init()
        cal s:Reset()
            cal call('s:opts', ...
                let s:lash = ctrlp#utils#lash()     <--- FuncUndefined event occurs here

although ctrlp#utils#lash() is defined in file ctrlp.vim/autoload/ctrlp/utils.vim

Severity:

Seen with versions:

Vim: 8.2 (Debian stable package 2:8.2.2434-3+deb11u1) Ctrlp: commit 8b4a952

Reproduce by:

  1. In vimrc: autocmd FuncUndefined * echom "FuncUndefined event occurred"
  2. Start vim
  3. :messages output is clean
  4. \<C-p>
  5. \<ESC>
  6. :messages output includes "FuncUndefined event occurred"
  7. The location that generates the FuncUndefined event is confirmed by editing the file to add 'echom' statments immediately before and after the problem line identified above in the s:opts() function in the file ctrlp.vim/autoload/ctrlp.vim like this:
    fu! s:opts(...)
    ...
    echom "before"
    let s:lash = ctrlp#utils#lash()
    echom "after"
    ...
jelibabi commented 2 years ago

After reading ':help autoload' in vim, I guess that a FuncUndefined event occurring is just a normal aspect of how autoloading works?

So I'm going to close this issue. I have only been using vimscript for a short time, so I am still learning about it, and I had not seen that event before.

Edit: Yes, I found ':help write-library-script' now which explains it. So I am sorry for making this unnecessary report.