Fix: De-Register Tabpage on Correct Close Event (#168)
This fixes a bug where the reviewer tab would be erroneously marked as closed. This is a PATCH release.
This commit is contained in:
committed by
GitHub
parent
b623c06119
commit
b6f023373a
@@ -50,17 +50,15 @@ M.open = function()
|
|||||||
u.notify("This merge request has conflicts!", vim.log.levels.WARN)
|
u.notify("This merge request has conflicts!", vim.log.levels.WARN)
|
||||||
end
|
end
|
||||||
|
|
||||||
local group = vim.api.nvim_create_augroup("gitlab.diffview.autocommand.close", {})
|
-- Register Diffview hook for close event to set tab page # to nil
|
||||||
vim.api.nvim_create_autocmd("User", {
|
local on_diffview_closed = function(view)
|
||||||
pattern = { "DiffviewViewClosed" },
|
if view.tabpage == M.tabnr then
|
||||||
group = group,
|
M.tabnr = nil
|
||||||
callback = function()
|
end
|
||||||
--Check if our diffview tab was closed
|
end
|
||||||
if vim.api.nvim_tabpage_is_valid(M.tabnr) then
|
require("diffview.config").user_emitter:on("view_closed", function(_, ...)
|
||||||
M.tabnr = nil
|
on_diffview_closed(...)
|
||||||
end
|
end)
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
if state.settings.discussion_tree.auto_open then
|
if state.settings.discussion_tree.auto_open then
|
||||||
local discussions = require("gitlab.actions.discussions")
|
local discussions = require("gitlab.actions.discussions")
|
||||||
|
|||||||
Reference in New Issue
Block a user