feat(picker): allow appending original window <cWORD>, <cfile> and cursor line to prompt (#3134)

This commit is contained in:
Xavier Young
2024-05-28 05:02:25 +08:00
committed by GitHub
parent 4c96370cf9
commit 2df52609a1
5 changed files with 55 additions and 0 deletions

View File

@@ -1496,6 +1496,27 @@ actions.insert_original_cword = function(prompt_bufnr)
current_picker:set_prompt(current_picker.original_cword, false)
end
--- Insert the WORD under the cursor of the original (pre-Telescope) window
---@param prompt_bufnr number: The prompt bufnr
actions.insert_original_cWORD = function(prompt_bufnr)
local current_picker = action_state.get_current_picker(prompt_bufnr)
current_picker:set_prompt(current_picker.original_cWORD, false)
end
--- Insert the file under the cursor of the original (pre-Telescope) window
---@param prompt_bufnr number: The prompt bufnr
actions.insert_original_cfile = function(prompt_bufnr)
local current_picker = action_state.get_current_picker(prompt_bufnr)
current_picker:set_prompt(current_picker.original_cfile, false)
end
--- Insert the line under the cursor of the original (pre-Telescope) window
---@param prompt_bufnr number: The prompt bufnr
actions.insert_original_cline = function(prompt_bufnr)
local current_picker = action_state.get_current_picker(prompt_bufnr)
current_picker:set_prompt(current_picker.original_cline, false)
end
actions.nop = function(_) end
actions.mouse_click = function(prompt_bufnr)