rcarriga / nvim-notify

A fancy, configurable, notification manager for NeoVim
MIT License
2.97k stars 78 forks source link

Failure to install it correctly - Error executing Lua callback #146

Closed TC72 closed 1 year ago

TC72 commented 1 year ago

I know I've done something wrong with the install so any help would be appreciated. I'm running Neovim 0.8.0

I installed with packer:

    use 'rcarriga/nvim-notify'

I have a notify_config.lua file I call with the debug config values right now:

require("notify").setup {
    background_colour = "Normal",
    fps = 30,
    icons = {
        DEBUG = "",
        ERROR = "",
        INFO = "",
        TRACE = "✎",
        WARN = ""
    },
    level = 2,
    minimum_width = 50,
    render = "default",
    stages = "fade_in_slide_out",
    timeout = 5000,
    top_down = true
}
vim.notify = require("notify")

If I try to display a notification with this:

:lua require("notify")("test")

I get this output:

Error running notification service: ...pack/packer/start/nvim-notify/lua/notify/stages/util.lua:78: attempt to call method 'get' (a table value

I get something else if I try to use the telescope extension :Telescope notify after using :lua require("telescope").load_extension("notify")

Error executing Lua callback: ...pack/packer/start/nvim-notify/lua/notify/config/init.lua:177: attempt to call method 'get' (a table value)
stack traceback:
        ...pack/packer/start/nvim-notify/lua/notify/config/init.lua:177: in function 'setup'
        ...m/site/pack/packer/start/nvim-notify/lua/notify/init.lua:168: in function 'instance'
        ...m/site/pack/packer/start/nvim-notify/lua/notify/init.lua:30: in function 'setup'
        ...m/site/pack/packer/start/nvim-notify/lua/notify/init.lua:113: in function 'history'
        ...r/start/nvim-notify/lua/telescope/_extensions/notify.lua:32: in function <...r/start/nvim-notify/lua/telescope/_extensions/notify.lua:31>
        ...ck/packer/start/telescope.nvim/lua/telescope/command.lua:193: in function 'run_command'
        ...ck/packer/start/telescope.nvim/lua/telescope/command.lua:253: in function 'load_command'
        ...te/pack/packer/start/telescope.nvim/plugin/telescope.lua:108: in function <...te/pack/packer/start/telescope.nvim/plugin/telescope.lua:107>

I've tracked down the code it's complaining about and get this line:

  local top = vim.opt.tabline:get() == "" and 0 or 1

I'm having a similar issue with another plugin which uses get() on something from vim.opt

TC72 commented 1 year ago

This was my bad. I'd copied some config code which did this and was overriding the new way to use vim.opt:

vim.opt = setmetatable({}, opt_mt)