feat(actions): add delete_mark (#2769)
* feat(actions): add delete_mark * style(init.lua): fix formatting
This commit is contained in:
@@ -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
|
||||
|
||||
-- ==================================================
|
||||
|
||||
Reference in New Issue
Block a user