summaryrefslogtreecommitdiff
path: root/lua/telescope/actions
diff options
context:
space:
mode:
authorTJ DeVries <devries.timothyj@gmail.com>2022-05-15 16:08:16 -0400
committerGitHub <noreply@github.com>2022-05-15 22:08:16 +0200
commit0b5f1d69d793660900552ad4606c3adcc9934963 (patch)
tree7fcec0a6f058ab0551d0c02ee4250cb03abc4e25 /lua/telescope/actions
parent2e421ef02dd1acf596d6c382d27230381a946b47 (diff)
feat: Add ability to choose window to edit (#745)
Diffstat (limited to 'lua/telescope/actions')
-rw-r--r--lua/telescope/actions/set.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/lua/telescope/actions/set.lua b/lua/telescope/actions/set.lua
index b880424..51267ce 100644
--- a/lua/telescope/actions/set.lua
+++ b/lua/telescope/actions/set.lua
@@ -130,8 +130,12 @@ action_set.edit = function(prompt_bufnr, command)
local entry_bufnr = entry.bufnr
- local picker = action_state.get_current_picker(prompt_bufnr)
require("telescope.actions").close(prompt_bufnr)
+ local picker = action_state.get_current_picker(prompt_bufnr)
+ local win_id = picker.get_selection_window(picker, entry)
+ if win_id ~= 0 and a.nvim_get_current_win() ~= win_id then
+ vim.api.nvim_set_current_win(win_id)
+ end
if picker.push_cursor_on_edit then
vim.cmd "normal! m'"