Skip to content

Commit

Permalink
fix(calendar): if another calendar is open then close it instead of e…
Browse files Browse the repository at this point in the history
…rroring
  • Loading branch information
vhyrro committed May 14, 2023
1 parent 779d089 commit 9751e7d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lua/neorg/modules/core/ui/calendar/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ module.private = {
end,

open_window = function(options)
local bufid = vim.fn.bufnr("neorg://calendar")

if bufid ~= -1 then
vim.api.nvim_buf_delete(bufid, { force = true })
end

local buffer, window = module.required["core.ui"].create_split(
"calendar",
{},
Expand Down

0 comments on commit 9751e7d

Please sign in to comment.