nvim-lualine / lualine.nvim

A blazing fast and easy to configure neovim statusline plugin written in pure lua.
MIT License
5.81k stars 461 forks source link

Bug: lualine is forcing the load of oil.nvim #1274

Closed polirritmico closed 2 weeks ago

polirritmico commented 3 weeks ago

Self Checks

How to reproduce the problem

Minimal config mininit.lua:

--- Minimal init
-- run with `nvim -u mininit.lua`

-- set stdpaths to use repro folder
local root = vim.fn.fnamemodify("./mininit", ":p")
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.uv.fs_stat(lazypath) then
  vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath })
end
vim.opt.runtimepath:prepend(lazypath)

-- plugins
local plugins = {
  {
    "nvim-lualine/lualine.nvim",
    -- commit = "e208967",
    dependencies = { "nvim-tree/nvim-web-devicons" },
    event = "VeryLazy",
    opts = {},
  },
  {
    "stevearc/oil.nvim",
    dependencies = { "nvim-tree/nvim-web-devicons" },
    lazy = true,
  },
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})
  1. Create a directory and put the minimal config mininit.lua into it
  2. Init a git repo: git init && git add mininit.lua && git commit -m "base commit"
  3. Run neovim: nvim -u mininit.lua
  4. Close neovim
  5. Run neovim again: nvim -u mininit.lua
  6. Oil is loaded!: :=require("lazy.core.config").plugins["oil.nvim"]._.loaded

Checkout to commit e208967 work as expected (after previous steps):

  1. Uncomment line 21: sed -i '21 s/-- //' mininit.lua
  2. Run neovim: nvim -u mininit.lua
  3. Checkout the target commit: :Lazy sync
  4. Close and reopen neovim: nvim -u mininit.lua
  5. Oil is NOT loaded!: :=require("lazy.core.config").plugins["oil.nvim"]._.loaded

Expected behaviour

Lualine should not force the load of oil.nvim

Actual behaviour

Lualine is forcing the load of oil.nvim

Additional information

$ nvim --version
NVIM v0.10.0
Build type: Release
LuaJIT 2.1.0-beta3
:=require("lazy.core.config").version
11.10.4

Edit: fat fingers typo

polirritmico commented 3 weeks ago

Here is the problematic PR: #1242