-
Notifications
You must be signed in to change notification settings - Fork 395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(loader): always load plugins in order of priority #1607
base: main
Are you sure you want to change the base?
Conversation
Sorry for force push, I do that because I didn't format the file, sorry. |
It may be unclear with my previous statement. So, when invoking the command {
InsertEnter = {
LuaSnip = "LuaSnip",
["cmp-spell"] = "cmp-spell",
["fittencode.nvim"] = "fittencode.nvim",
["nvim-treesitter-endwise"] = "nvim-treesitter-endwise"
},
LspAttach = {
["cmp-nvim-lsp"] = "cmp-nvim-lsp",
["cmp-nvim-lsp-document-symbol"] = "cmp-nvim-lsp-document-symbol",
["lspsaga.nvim"] = "lspsaga.nvim",
["nvim-navic"] = "nvim-navic",
["symbol-usage.nvim"] = "symbol-usage.nvim"
},
} And in this code: lazy.nvim/lua/lazy/core/handler/event.lua Lines 83 to 86 in d1de92d
The event handler uses the table as an argument for the function And what I do is just make every plugin table that passed into |
This PR is stale because it has been open 30 days with no activity. |
This PR is stale because it has been open 30 days with no activity. |
Problem :
The plugins stored in
require("lazy.core.handler").handlers[type]active
is a hash map, it will be disordered to userequire("lazy.core.loader").load
to load it.Solution:
Convert every plugin that passed in
require("lazy.core.loader").load
to a list at first, and usetable.sort
to make them in order of priority.My plugin list:
Before:
After:
Note that the plugins with higher priority will be loaded first.