feat: add skip_confirm_for_delete option (#77)

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:29:12 -05:00 committed by GitHub
parent 7a46246062
commit ba49f76e91
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 22 additions and 1 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)