From 81126403a89b78e6a75948ba5cea15d9499d2025 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 22 Dec 2022 23:08:06 +0100 Subject: [PATCH] feat!: `init()` no longer implies lazy-loading. Add `lazy=false` for affected plugins --- README.md | 2 -- lua/lazy/core/plugin.lua | 1 - 2 files changed, 3 deletions(-) diff --git a/README.md b/README.md index 491b48b5..6406efab 100644 --- a/README.md +++ b/README.md @@ -125,7 +125,6 @@ Plugins will be lazy-loaded when one of the following is `true`: - the plugin only exists as a dependency in your spec - it has an `event`, `cmd`, `ft` or `keys` key -- it defines an `init` method - `config.defaults.lazy == true` #### ⌨️ Lazy Key Mappings @@ -244,7 +243,6 @@ return { { "cshuaimin/ssr.nvim", -- init is always executed during startup, but doesn't load the plugin yet. - -- init implies lazy loading init = function() vim.keymap.set({ "n", "x" }, "cR", function() -- this require will automatically load the plugin diff --git a/lua/lazy/core/plugin.lua b/lua/lazy/core/plugin.lua index 844db738..90c687ec 100644 --- a/lua/lazy/core/plugin.lua +++ b/lua/lazy/core/plugin.lua @@ -201,7 +201,6 @@ function M.update_state() or plugin.keys or plugin.ft or plugin.cmd - or plugin.init plugin.lazy = lazy and true or false end if plugin.dir:find(Config.options.root, 1, true) == 1 then