Skip to content

Commit 0a3f0e7

Browse files
zhafacaihamidi-dev
authored andcommitted
close window before quit
close window in help
1 parent bccd30d commit 0a3f0e7

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

lua/org-super-agenda/adapters/neovim/actions.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1142,7 +1142,7 @@ function A.set_keymaps(buf, win, line_map, reopen)
11421142
-- Popup mode: detach from tmux session to hide the popup
11431143
vim.fn.system(popup.hide_command)
11441144
else
1145-
-- Normal mode: close window + buffer
1145+
-- Normal mode: close buffer and window
11461146
if vim.api.nvim_win_is_valid(win) then
11471147
pcall(vim.api.nvim_win_close, win, true)
11481148
end

lua/org-super-agenda/adapters/neovim/utils.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ function U.show_help()
101101

102102
local ui = vim.api.nvim_list_uis()[1]
103103
local h, w = #out + 2, 60
104-
vim.api.nvim_open_win(buf, true, {
104+
local win = vim.api.nvim_open_win(buf, true, {
105105
relative = 'editor',
106106
style = 'minimal',
107107
border = 'rounded',
@@ -113,6 +113,7 @@ function U.show_help()
113113
})
114114

115115
local function close()
116+
pcall(vim.api.nvim_win_close, win, true)
116117
pcall(vim.api.nvim_buf_delete, buf, { force = true })
117118
end
118119
for _, k in ipairs({ 'g?', 'q', '<Esc>' }) do

0 commit comments

Comments
 (0)