Skip to content
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

bug: neovim freezes on cond = false using lazy.nvim v10.4.0 #1061

Closed
3 tasks done
abeldekat opened this issue Sep 30, 2023 · 2 comments · Fixed by #1062
Closed
3 tasks done

bug: neovim freezes on cond = false using lazy.nvim v10.4.0 #1061

abeldekat opened this issue Sep 30, 2023 · 2 comments · Fixed by #1062
Labels
bug Something isn't working

Comments

@abeldekat
Copy link
Contributor

abeldekat commented Sep 30, 2023

Did you check docs and existing issues?

  • I have read all the lazy.nvim docs
  • I have searched the existing issues of lazy.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

0.9.2

Operating system/version

arch linux

Describe the bug

In LazyVim, plugin nvim-lspconfig has neoconf.nvim in its dependencies.
The definition of neoconf.nvim inside those dependencies also contains a dependency, back to nvim-lspconfig.

Using lazy.nvim version 10.4.0 and LazyVim, neovim freezes when conditionally disabling neoconf.nvim or nvim-lspconfig.
The previous version of lazy.nvim, without #1058, runs just fine

Note:

  1. using enabled=false works as intended
  2. using cond=false works as intended for other plugins

Steps To Reproduce

  1. Run nvim -u repro.lua repro.lua
  2. Restart, uncomment line: { "folke/neoconf.nvim", cond = false }
  3. Run nvim -u repro.lua repro.lua
  4. Neovim freezes, showing a blank screen
  5. Restart, uncomment line: { "neovim/nvim-lspconfig", cond = false },
  6. Neovim freezes, showing a blank screen

Expected Behavior

The plugins can be conditionally disabled, as in older versions of lazy.nvim

Repro

-- Minimal `init.lua` to reproduce an issue.
-- Save as `repro.lua` and run with `nvim -u repro.lua`
local function bootstrap(root) -- sets std paths and installs lazy
  for _, name in ipairs({ "config", "data", "state", "cache" }) do
    vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
  end
  local lazypath = root .. "/plugins/lazy.nvim"
  if not vim.loop.fs_stat(lazypath) then
    vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath })
  end
  vim.opt.rtp:prepend(lazypath)
end
local root = vim.fn.fnamemodify("./.repro", ":p")
bootstrap(root)

-- install plugins:
local lazy_version = "*" -- newest 10.4.0
-- local lazy_version = "10.3.1"

local plugins = {
  "folke/tokyonight.nvim",
  { "LazyVim/LazyVim", import = "lazyvim.plugins" },
  { "folke/lazy.nvim", version = lazy_version },
  -- add any other plugins here
  -- { "folke/neoconf.nvim", enabled = false }, --> this works!
  -- { "folke/neoconf.nvim", cond = false }, --> this crashes on 10.4.0
  -- { "neovim/nvim-lspconfig", enabled = false }, --> this works!
  -- { "neovim/nvim-lspconfig", cond = false }, --> this crashes on 10.4.0
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})
@abeldekat abeldekat added the bug Something isn't working label Sep 30, 2023
@abeldekat abeldekat changed the title bug: neovim can freez on cond = false using lazy.nvim v10.4.0 bug: neovim freezes on cond = false using lazy.nvim v10.4.0 Sep 30, 2023
@folke
Copy link
Owner

folke commented Sep 30, 2023

I think I know what's causing this. Not home right now. Will check later today. Thank you for reporting!

@abeldekat
Copy link
Contributor Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants