tani / vim-jetpack

The lightning-fast plugin manager, alternative to vim-plug
https://gist.asciidoctor.org/?github-tani/vim-jetpack/main//README.adoc&source-highlighter=highlightjs
MIT License
317 stars 31 forks source link

cmp-cmdline does not work on CmdEnter #93

Closed tani closed 1 year ago

tani commented 1 year ago

@gw31415 said

Thanks. I have confirmed that the error that appears on first startup is resolved.

However, I noticed that even after revision, cmp-cmdline is not working even after CmdlineEnter. It does not seem to be due to the order in which the plugins are loaded (confirmed by print debugging).

Here is vim-jetpack case: image

Here is packer.nvim:case: image

In the case of vim-jetpack, nvim-cmp is not shown. These tests is conducted in the containers mentioned in this comment.

I created simple docker containers to check this behavior. containers.tar.gz

containers
├── jetpack
│   ├── Dockerfile
│   └── init.lua
└── packer
    ├── Dockerfile
    └── init.lua

The first problem is solved, so I'm going to close this issue. Thank you very much.

tani commented 1 year ago

I will work on this issue next month.

tani commented 1 year ago

これが原因でした。cmp-cmdlineのafter/pluginが読み込まれていないため失敗しています。

runtimepathには追加されるので、初期化時の:packaddなら問題ない。 :help load-plugins つまり、以下のように初期化時の処理の最後に呼ばれる+{command}だと読み込まれない。

https://zenn.dev/notomo/articles/neovim-plugin-manager-optpack#%E5%88%9D%E6%9C%9F%E5%8C%96%E6%99%82%E4%BB%A5%E5%A4%96%E3%81%AB%3Apackadd%E3%81%97%E3%81%A6%E3%82%82after%2Fplugin%E3%83%87%E3%82%A3%E3%83%AC%E3%82%AF%E3%83%88%E3%83%AA%E3%81%AF%E8%AA%AD%E3%81%BF%E8%BE%BC%E3%81%BE%E3%82%8C%E3%81%AA%E3%81%84

tani commented 1 year ago

I tought that this issue is inconsistent with respect to the loading order. I means that it may be never solved.

This is the cyclic dependency. It theoretically is imposslble to solve such a depdency. To solve this issue, you should load before VimEnter. I means that you should use the non-lazyloading.

tani commented 1 year ago

Please check the latest commit. I confirmed that it is solved. Thank you for the great contribution 🍻

gw31415 commented 1 year ago

It worked properly with the latest version of the commit (ddbcbf2b). Thanks for the fix!