lukas-reineke / indent-blankline.nvim

Indent guides for Neovim
MIT License
4.16k stars 102 forks source link

module 'ibl.hooks' not found #774

Closed ellik159 closed 11 months ago

ellik159 commented 11 months ago

Problem

When i try to require hooks:

{
    "lukas-reineke/indent-blankline.nvim",
    main="ibl",
    config = function()
      require "ibl.hooks"
      -- require("lvim.core.indentlines").setup()
    end,
    opts={},
    -- event = "User FileOpened",
  },

throw the following error:

Failed to run `config` for indent-blankline.nvim
\lunarvim\lvim/lua/lvim/plugins.lua:330: module 'ibl.hooks' not found:
^Ino field package.preload['ibl.hooks']
cache_loader: module ibl.hooks not found
cache_loader_lib: module ibl.hooks not found

Im use lunarvim as base but i disabled all to try.

Steps to reproduce

  1. Install indent as description line
  2. Watch the error PD:Im in windows

Expected behavior

Im trying to enable multicolor indentation

Neovim version (nvim -v)

0.9.2

lukas-reineke commented 11 months ago

The config is correct. You most likely haven't installed the plugin correctly. Does it show up when you run :Lazy?

ellik159 commented 11 months ago

This is lunar default config.

local M = {}

M.config = function()
  lvim.builtin.indentlines = {
    active = true,
    on_config_done = nil,
    options = {
      enabled = true,
      buftype_exclude = { "terminal", "nofile" },
      filetype_exclude = {
        "help",
        "startify",
        "dashboard",
        "lazy",
        "neogitstatus",
        "NvimTree",
        "Trouble",
        "text",
      },
      char = lvim.icons.ui.LineLeft,
      context_char = lvim.icons.ui.LineLeft,
      show_trailing_blankline_indent = false,
      show_first_indent_level = true,
      use_treesitter = true,
      show_current_context = true,
    },
  }
end

M.setup = function()
  local status_ok, indent_blankline = pcall(require, "indent_blankline")
  if not status_ok then
    return
  end

  indent_blankline.setup(lvim.builtin.indentlines.options)

  if lvim.builtin.indentlines.on_config_done then
    lvim.builtin.indentlines.on_config_done()
  end
end

return M
{
    "lukas-reineke/indent-blankline.nvim",
    config = function()
      require("lvim.core.indentlines").setup()
    end,
    event = "User FileOpened",
    enabled = lvim.builtin.indentlines.active,
  },

The pcall call require works with indent_blankline if i try to change to ibl crash.

M.setup = function()
  local status_ok, indent_blankline = pcall(require, "ibl")
  if not status_ok then
    return
  end
  print("hi")
  -- indent_blankline.setup(lvim.builtin.indentlines.options)

  if lvim.builtin.indentlines.on_config_done then
    lvim.builtin.indentlines.on_config_done()
  end
end

return M

Other option its specify main module and remove lazy option with the same require. And crash too.

Plugin folder is delete for each test to force lazy download and load.

{
"lukas-reineke/indent-blankline.nvim",
main = "ibl",
config = function()
require("lvim.core.indentlines").setup()
end,
lazy=false,
-- event = "User FileOpened",
enabled = lvim.builtin.indentlines.active,
},

and with with config if i change require to

local status_ok, indent_blankline = pcall(require, "indent_blankline")

as original still work. Import hooks form indent_blankline crash too.

local status_ok, indent_blankline = pcall(require, "indent_blankline.hooks")

So i dont know why but it seems that the module takes indent_blankline name. Told me if the could be lunar problem.

ellik159 commented 11 months ago

The config is correct. You most likely haven't installed the plugin correctly. Does it show up when you run :Lazy?

Nothing , the download work ok, and its loaded with no problem.

lukas-reineke commented 11 months ago

The pcall call require works with indent_blankline if i try to change to ibl crash.

This means you have an old version installed. Maybe it's cached somewhere? Sorry, I don't use LunarVim, I can't really help you.

ellik159 commented 11 months ago

@lukas-reineke omg , lunar use 2.2 version . Thx to much.