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: If one of your plugin entries doesn't exist lazy will freak out and lock up neovim #303

Closed
3 tasks done
RoryNesbitt opened this issue Jan 3, 2023 · 0 comments · Fixed by #281
Closed
3 tasks done
Labels
bug Something isn't working

Comments

@RoryNesbitt
Copy link

RoryNesbitt commented Jan 3, 2023

Did you check docs and existing issues?

  • I have read all the lazy docs
  • I have searched the existing issues of lazy
  • I have searched the exsiting issues of the plugin I have a problem with

Neovim version (nvim -v)

0.8.2

Operating system/version

Endeavour OS

Describe the bug

if the plugins table includes a string that doesn't exist (e.g. a typo) then lazy will fail to clone it causing it to rapidly switch between the word "clone" in yellow and the "failed to clone, directory exists and is not empty" error.

To stop this you need to hit Ctrl-C a few times and then remove this entry, either before closing the broken instance or with --clean. Sometimes the floating window doesn't go away making this more difficult but still possible.

Interestingly on mine it was trying to download the last plugin I deleted even though that was before the broken instance of the setup

Steps To Reproduce

Setup as normal
change or add an entry that doesn't match a plugin url (an empty string will do it)
save the file
restart neovim

Expected Behavior

A message along the lines of "this plugin doesn't exist, fix it you idiot"

Repro

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
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.loop.fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "--single-branch",
    "https://github.com/folke/lazy.nvim.git",
    lazypath,
  })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
  -- add any other plugins here
  "",
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here
@RoryNesbitt RoryNesbitt added the bug Something isn't working label Jan 3, 2023
@folke folke closed this as completed in c85f929 Jan 3, 2023
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.

1 participant