LazyVim / LazyVim

Neovim config for the lazy
https://lazyvim.github.io/
Apache License 2.0
17.59k stars 1.24k forks source link

bug: telescope fail to open buffer after disabling edgy #4347

Closed Zikoel closed 3 months ago

Zikoel commented 3 months ago

Did you check docs and existing issues?

Neovim version (nvim -v)

NVIM v0.10.1

Operating system/version

Linux Mint 20.2

Describe the bug

After added the extra "folke/edgy.nvim" I choose to disable it, after that telescope stopping open buffer reporting this error:

   Error  04:12:39 PM msg_show.emsg E5108: Error executing lua: ...nvim/lazy/LazyVim/lua/lazyvim/plugins/extras/ui/edgy.lua:130: module 'edgy' not found:
    no field package.preload['edgy']
cache_loader: module edgy not found
cache_loader_lib: module edgy not found
    no file './edgy.lua'
    no file '/home/runner/work/neovim/neovim/.deps/usr/share/luajit-2.1/edgy.lua'
    no file '/usr/local/share/lua/5.1/edgy.lua'
    no file '/usr/local/share/lua/5.1/edgy/init.lua'
    no file '/home/runner/work/neovim/neovim/.deps/usr/share/lua/5.1/edgy.lua'
    no file '/home/runner/work/neovim/neovim/.deps/usr/share/lua/5.1/edgy/init.lua'
    no file '/home/elia/.local/share/lazy-nvim/lazy-rocks/telescope.nvim/share/lua/5.1/edgy.lua'
    no file '/home/elia/.local/share/lazy-nvim/lazy-rocks/telescope.nvim/share/lua/5.1/edgy/init.lua'
    no file './edgy.so'
    no file '/usr/local/lib/lua/5.1/edgy.so'
    no file '/home/runner/work/neovim/neovim/.deps/usr/lib/lua/5.1/edgy.so'
    no file '/usr/local/lib/lua/5.1/loadall.so'
    no file '/home/elia/.local/share/lazy-nvim/lazy-rocks/telescope.nvim/lib/lua/5.1/edgy.so'
stack traceback:
    [C]: in function 'require'
    ...nvim/lazy/LazyVim/lua/lazyvim/plugins/extras/ui/edgy.lua:130: in function 'get_selection_window'
    ...y-nvim/lazy/telescope.nvim/lua/telescope/actions/set.lua:174: in function 'run_replace_or_original'
    ...zy-nvim/lazy/telescope.nvim/lua/telescope/actions/mt.lua:65: in function 'run_replace_or_original'
    ...zy-nvim/lazy/telescope.nvim/lua/telescope/actions/mt.lua:65: in function 'run_replace_or_original'
    ...zy-nvim/lazy/telescope.nvim/lua/telescope/actions/mt.lua:65: in function 'key_func'
    ...lazy-nvim/lazy/telescope.nvim/lua/telescope/mappings.lua:293: in function <...lazy-nvim/lazy/telescope.nvim/lua/telescope/mappings.lua:292>

I have a very standard LazyVim configuration, I only have switch to catpuccin theme, so my customized conf is empty right now.

Steps To Reproduce

  1. Add extra edgy
  2. disable it with
    {
    "folke/edgy.nvim",
    enabled = false,
    }
  3. enter telescope, search for a file and press enter

Expected Behavior

I expect to not see the error and open the buffer as usual.

Repro

vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()

require("lazy.minit").repro({
  spec = {
    { "LazyVim/LazyVim", import = "lazyvim.plugins" },
    -- add any other plugins here
  },
})
Zikoel commented 3 months ago

I found the way to correct the problem: disable the extra from the LazyExtra interface. But i'm not sure if I understand well what happen. At this point I understand that an extra is not equivalent to a plugin, so it cannot be disabled as a plugin ?

dpetka2001 commented 3 months ago

No, it can't. An Extra is just a Lua module that gets toggled on/off and contains different plugin specs. When the edgy Extra is enabled then the plugin specs in this file are all in effect. You can see that the other plugin specs depend on edgy being enabled. (require("edgy") in Telescope and Bufferline specs).

So, the correct way to disable an Extra is the way you enabled it, through the LazyExtras UI.