Skip to content

Error: Error executing lua callback: ...e/nvim/lazy/pommodoro-clock.nvim/lua/pommodoro-clock.lua:233: attempt to index field 'popup' (a nil value) #7

@nyngwang

Description

@nyngwang

These are the lines that caused the following error:

pcall(vim.api.nvim_create_autocmd, { "WinResized" }, {
group = vim.api.nvim_create_augroup("refresh_popup_layout", { clear = true }),
callback = function()
M.current_state.popup:update_layout()
end,
})

01:33:26 msg_show Error executing lua callback: ...e/nvim/lazy/pommodoro-clock.nvim/lua/pommodoro-clock.lua:233: attempt to index field 'popup' (a nil value)
stack traceback:
	...e/nvim/lazy/pommodoro-clock.nvim/lua/pommodoro-clock.lua:233: in function <...e/nvim/lazy/pommodoro-clock.nvim/lua/pommodoro-clock.lua:232>

To reproduce:

  1. run require('pommodoro-clock').start(some_key).
  2. run require('pommodoro-clock').close().
  3. create a vsplit.

I believe that you should remove this autocmd after it's close()d.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions