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: error detected while processing CursorMoved Autocommands for "*": Plugin nvim-lightbulb is not installed #272

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

Comments

@fgheng
Copy link

fgheng commented Jan 1, 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.9.0-dev-484+gb5edea655

Operating system/version

arch linux and mac os

Describe the bug

I want to lazy load plugin "lightblub" on events "InsertEnter" and "CursorMoved".
But while I first open the neovim without install any plugins, an error message occured 'error detected while processing CursorMoved Autocommands for "*": Plugin nvim-lightbulb is not installed'

I think this is caused by loading plugin without detecting whether it is installed.

Steps To Reproduce

  1. nvim -u repo.lua, repo.lua will write below

Expected Behavior

Install plugin firstly and then loaded it if the plugin is not installed.

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
{
    "kosayoda/nvim-lightbulb",
    config = true,
    event = {"InsertEnter", "CursorMoved"}
}

}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

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