Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions lua/neo-tree/ui/popups.lua
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,12 @@ M.alert = function(title, message, size)

local success, msg = pcall(vim.api.nvim_buf_set_lines, win.bufnr, 0, 0, false, lines)
if success then
win:map("n", "<esc>", function(bufnr)
win:unmount()
end, { noremap = true })

win:map("n", "<enter>", function(bufnr)
win:unmount()
end, { noremap = true })
local exit_keys = { "<esc>", "<enter>", "q" }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is reasonable. The only issue is that now the message on line 92 is out of sync with the mappings.

for _, key in ipairs(exit_keys) do
win:map("n", key, function(bufnr)
win:unmount()
end, { noremap = true })
end

local event = require("nui.utils.autocmd").event
win:on({ event.BufLeave, event.BufDelete }, function()
Expand Down