vim-denops / denops.vim

🐜 An ecosystem of Vim/Neovim which allows developers to write cross-platform plugins in Deno
https://vim-denops.github.io/denops-documentation/
MIT License
665 stars 33 forks source link

`denops#plugin#is_loaded()` returns 0 at called from DenopsPluginPost event. #311

Closed kuuote closed 8 months ago

kuuote commented 8 months ago

Problem

denops#plugin#is_loaded() returns 0 at called from DenopsPluginPost event.

Environment

Neovim: NVIM v0.10.0-dev-1301+g30d311ebc-dirty denops.vim: 8e580f03fa902cc511930cd0a848ab2643089697 denops.vim(v6-pre): 13572512cc99e4459476305aaf4aaec23b60a4ea

To Reproduce

init.vim

set rtp+=/data/vim/repos/github.com/vim-denops/denops.vim
let s:script = expand('<sfile>:h') .. '/a.js'
autocmd User DenopsReady call denops#plugin#load('a', s:script)
autocmd User DenopsPluginPost:a echo denops#plugin#is_loaded('a')

a.js

export function main(){}

Place above sources and nvim -u init.vim. so display 0

Note

Cause of it problem is call user defined event before internal event since https://github.com/vim-denops/denops.vim/commit/e5fc965e5d66d6823ddfef60b29c9e534e893f57