Skip to content

Commit

Permalink
refactor(actions): buf_del condition (#1697)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibhagwan committed Jan 10, 2025
1 parent 54d505c commit c238e01
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lua/fzf-lua/actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -406,9 +406,8 @@ M.buf_del = function(selected, opts)
for _, sel in ipairs(selected) do
local entry = path.entry_to_file(sel, opts)
if entry.bufnr then
if not utils.buffer_is_dirty(entry.bufnr, true, false) then
vim.api.nvim_buf_delete(entry.bufnr, { force = true })
elseif vim.api.nvim_buf_call(entry.bufnr, function()
if not utils.buffer_is_dirty(entry.bufnr, true, false)
or vim.api.nvim_buf_call(entry.bufnr, function()
return utils.save_dialog(entry.bufnr)
end)
then
Expand Down

0 comments on commit c238e01

Please sign in to comment.