Bugfix: We must allow most actions to occur after the popup closes.

Some (like editing the title and description) need the popup text and
should execute prior to closure. This is now configurable via an options
table that can be passed to the set_popup_keymaps function.
This commit is contained in:
Harrison Cramer
2023-09-08 20:45:28 -04:00
parent f6fb61607c
commit c8c7d86e84
2 changed files with 13 additions and 6 deletions

View File

@@ -48,8 +48,9 @@ M.summary = function()
vim.schedule(function()
vim.api.nvim_buf_set_lines(currentBuffer, 0, -1, false, lines)
vim.api.nvim_buf_set_lines(title_popup.bufnr, 0, -1, false, { title })
state.set_popup_keymaps(description_popup, M.edit_summary, miscellaneous.attach_file, exit)
state.set_popup_keymaps(title_popup, M.edit_summary, nil, exit)
state.set_popup_keymaps(description_popup, M.edit_summary, miscellaneous.attach_file,
{ cb = exit, action_before_close = true })
state.set_popup_keymaps(title_popup, M.edit_summary, nil, { cb = exit, action_before_close = true })
end)
end