feat: delete entry from the picker without closing telescope (#828)
This action is not mapped but you can do it yourself in your telescope setup call
Example config:
```lua
require("telescope").setup {
pickers = {
buffers = {
mappings = {
i = {
["<c-d>"] = "delete_buffer",
}
}
}
}
}
```
This commit is contained in:
@@ -650,6 +650,15 @@ actions.open_loclist = function(_)
|
||||
vim.cmd [[lopen]]
|
||||
end
|
||||
|
||||
--- Delete the selected buffer or all the buffers selected using multi selection.
|
||||
---@param prompt_bufnr number: The prompt bufnr
|
||||
actions.delete_buffer = function(prompt_bufnr)
|
||||
local current_picker = action_state.get_current_picker(prompt_bufnr)
|
||||
current_picker:delete_selection(function(selection)
|
||||
vim.api.nvim_buf_delete(selection.bufnr, { force = true })
|
||||
end)
|
||||
end
|
||||
|
||||
-- ==================================================
|
||||
-- Transforms modules and sets the corect metatables.
|
||||
-- ==================================================
|
||||
|
||||
Reference in New Issue
Block a user