summaryrefslogtreecommitdiff
path: root/lua/telescope/actions/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/telescope/actions/init.lua')
-rw-r--r--lua/telescope/actions/init.lua32
1 files changed, 32 insertions, 0 deletions
diff --git a/lua/telescope/actions/init.lua b/lua/telescope/actions/init.lua
index 1f047e2..3384b54 100644
--- a/lua/telescope/actions/init.lua
+++ b/lua/telescope/actions/init.lua
@@ -299,6 +299,38 @@ actions.select_tab = {
end,
}
+--- Perform 'drop' action on selection, usually something like<br>
+---`:drop <selection>`
+---
+--- i.e. open the selection in a window
+---@param prompt_bufnr number: The prompt bufnr
+actions.select_drop = {
+ pre = function(prompt_bufnr)
+ action_state
+ .get_current_history()
+ :append(action_state.get_current_line(), action_state.get_current_picker(prompt_bufnr))
+ end,
+ action = function(prompt_bufnr)
+ return action_set.select(prompt_bufnr, "drop")
+ end,
+}
+
+--- Perform 'tab drop' action on selection, usually something like<br>
+---`:tab drop <selection>`
+---
+--- i.e. open the selection in a new tab
+---@param prompt_bufnr number: The prompt bufnr
+actions.select_tab_drop = {
+ pre = function(prompt_bufnr)
+ action_state
+ .get_current_history()
+ :append(action_state.get_current_line(), action_state.get_current_picker(prompt_bufnr))
+ end,
+ action = function(prompt_bufnr)
+ return action_set.select(prompt_bufnr, "tab drop")
+ end,
+}
+
-- TODO: consider adding float!
-- https://github.com/nvim-telescope/telescope.nvim/issues/365