summaryrefslogtreecommitdiff
path: root/lua/telescope/mappings.lua
diff options
context:
space:
mode:
authorTJ DeVries <devries.timothyj@gmail.com>2020-08-27 22:55:44 -0400
committerTJ DeVries <devries.timothyj@gmail.com>2020-08-27 22:55:44 -0400
commit4100795d0ca64b2afd073e90435374a16f3ae962 (patch)
tree1965e78b562b113f3df4e561171cc130433cf7d4 /lua/telescope/mappings.lua
parentbb446421c5e97310fc0823c157d94cef624688bb (diff)
slightly better small screen UX
Diffstat (limited to 'lua/telescope/mappings.lua')
-rw-r--r--lua/telescope/mappings.lua5
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)