slightly better small screen UX

This commit is contained in:
TJ DeVries
2020-08-27 22:55:44 -04:00
parent bb446421c5
commit 4100795d0c
3 changed files with 24 additions and 6 deletions

View File

@@ -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)