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

error get when calling Telescope Notify: attempt to index local config (a nil value) #102

Closed
milanglacier opened this issue Jun 4, 2022 · 4 comments

Comments

@milanglacier
Copy link

milanglacier commented Jun 4, 2022

I am at Telescope version: commit d3aad43b3fcf707052f7dd8a7c7072fa69773f3c (latest at the time I post the issue)
and nvim-notify version b517277b2782b9fe20f64220435b8b6f9f02f840 (latest at the time I post the issue)

nvim version is

NVIM v0.7.0
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by brew@HMBRW-A-001-M1-004.local

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/opt/homebrew/Cellar/neovim/0.7.0/share/nvim"

Run :checkhealth for more info

minimal config:

--if lazy load nvim-notify and telescope-nvim:
--vim.cmd [[packadd nvim-notify]]
--vim.cmd [[packadd telescope-nvim]]
require('telescope').setup {}
    require('notify').setup {
        max_width = 45,
        max_height = 20,
    }
vim.notify = require("notify")
require('telescope').load_extension 'notify'

vim.notify("a message", vim.log.levels.WARN)

step to reproduce:

call Telescope notify
and get the following error

Error executing vim.schedule lua callback: ...ack/packer/opt/nvim-notify/lua/notify/render/default.lua:38: attempt to index local 'config' (a nil value)
stack traceback:
..ack/packer/opt/nvim-notify/lua/notify/render/default.lua:38:in function 'render'
.acker/opt/nvim-notify/lua/notify/service/buffer/init.lua:102:in function 'render'
..ker/opt/nvim-notify/la/telescope/_extensions/notifv.lua:94:in function
"define_preview'
...scope.nvim/lua/telescope/previewers/buffer_previewer.lua:386:infunction'preview'
.pack/packer/opt/telescope.nvim/lua/telescope/pickers.lua:1075: in function
'refresh_previewer'
.pack/packer/opt/telescope.nvim/lua/telescope/pickers.lua:1024: in function
'set_selection'
..pack/packer/opt/telescope.nvim/lua/telescope/pickers.lua:1360: in function
do_ selection'
..pack/packer/opt/telescope.nvim/lua/telescope/pickers.lua:1322: in function
vim/_editor.lua: in function <vim/ editor.lua:0>

update:
after some debug work, this bug happens after commit 2cfd425

@milanglacier
Copy link
Author

after some debug work, this bug happens after commit 2cfd425

@kiyonlin
Copy link

kiyonlin commented Jun 5, 2022

same here 😄

@milanglacier
Copy link
Author

milanglacier commented Jun 5, 2022

I think the reason is at here

local notif_buf = NotificationBuf(self.state.bufnr, notification, { max_width = max_width })

now NotificationBuf needs to get a config key from the table passed in, but we don't pass to it.

We need to find a way to pass user_config like what defined here:

local service = NotificationService(instance_config, animator)

to the telescope extension calling.

rcarriga added a commit that referenced this issue Jun 5, 2022
@rcarriga
Copy link
Owner

rcarriga commented Jun 5, 2022

Thanks for report 😄 Should be working in latest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants