feat(actions): add delete_mark (#2769)

* feat(actions): add delete_mark

* style(init.lua): fix formatting
This commit is contained in:
Chen Lu
2023-11-26 03:37:50 +00:00
committed by GitHub
parent 18774ec792
commit e4c62dedd7
2 changed files with 22 additions and 0 deletions

View File

@@ -1455,6 +1455,19 @@ actions.to_fuzzy_refine = function(prompt_bufnr)
})
end
--- Delete the selected mark or all the marks selected using multi selection.
---@param prompt_bufnr number: The prompt bufnr
actions.delete_mark = function(prompt_bufnr)
local current_picker = action_state.get_current_picker(prompt_bufnr)
current_picker:delete_selection(function(selection)
local bufname = selection.filename
local bufnr = vim.fn.bufnr(bufname)
local mark = selection.ordinal:sub(1, 1)
local success = pcall(vim.api.nvim_buf_del_mark, bufnr, mark)
return success
end)
end
actions.nop = function(_) end
-- ==================================================