diff options
Diffstat (limited to 'lua/telescope/mappings.lua')
| -rw-r--r-- | lua/telescope/mappings.lua | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lua/telescope/mappings.lua b/lua/telescope/mappings.lua index 1e79900..264a2d3 100644 --- a/lua/telescope/mappings.lua +++ b/lua/telescope/mappings.lua @@ -52,7 +52,8 @@ keymap["control-p"] = function(prompt_bufnr, _) end keymap["enter"] = function(prompt_bufnr, results_bufnr) - local entry = state.get_status(prompt_bufnr).picker:get_selection() + local picker = state.get_status(prompt_bufnr).picker + local entry = picker:get_selection() if not entry then print("[telescope] Nothing currently selected") @@ -72,6 +73,8 @@ keymap["enter"] = function(prompt_bufnr, results_bufnr) vim.cmd(string.format([[bdelete! %s]], prompt_bufnr)) + a.nvim_set_current_win(picker.original_win_id or 0) + local bufnr = vim.fn.bufnr(filename, true) a.nvim_set_current_buf(bufnr) a.nvim_buf_set_option(bufnr, 'buflisted', true) |
