mirror of
https://github.com/zoriya/telescope.nvim.git
synced 2025-12-06 06:46:10 +00:00
feat(actions): add delete_mark (#2769)
* feat(actions): add delete_mark * style(init.lua): fix formatting
This commit is contained in:
@@ -3311,6 +3311,15 @@ actions.to_fuzzy_refine({prompt_bufnr}) *telescope.actions.to_fuzzy_refine()*
|
||||
{prompt_bufnr} (number) The prompt bufnr
|
||||
|
||||
|
||||
actions.delete_mark({prompt_bufnr}) *telescope.actions.delete_mark()*
|
||||
Delete the selected mark or all the marks selected using multi
|
||||
selection.
|
||||
|
||||
|
||||
Parameters: ~
|
||||
{prompt_bufnr} (number) The prompt bufnr
|
||||
|
||||
|
||||
|
||||
================================================================================
|
||||
ACTIONS_STATE *telescope.actions.state*
|
||||
|
||||
@@ -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