feat: add \skip_confirm_for_delete\ option

Problem: there was no way to suppress the confirmation popup when the
only pending operations are deletes. \`skip_confirm_for_simple_edits\`
explicitly excludes deletes, so users who delete frequently had no opt-out.

Solution: add \`skip_confirm_for_delete = false\` config option. When true,
\`confirmation.show()\` skips the popup if every pending action is a delete.

Based on: stevearc/oil.nvim#392
This commit is contained in:
Barrett Ruth 2026-03-06 16:02:02 -05:00
parent a74747e1f5
commit f9c30d4947
Signed by: barrett
GPG key ID: A6C96C9349D2FC81
4 changed files with 33 additions and 12 deletions

View file

@ -67,6 +67,19 @@ M.show = vim.schedule_wrap(function(actions, should_confirm, cb)
cb(true)
return
end
if should_confirm == nil and config.skip_confirm_for_delete then
local all_deletes = true
for _, action in ipairs(actions) do
if action.type ~= 'delete' then
all_deletes = false
break
end
end
if all_deletes then
cb(true)
return
end
end
-- Create the buffer
local bufnr = vim.api.nvim_create_buf(false, true)