summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Hauser <Simon-Hauser@outlook.de>2020-09-18 15:18:27 +0200
committerGitHub <noreply@github.com>2020-09-18 09:18:27 -0400
commit7b1ebe7fce65761293b82834ff997174cf2baa74 (patch)
treec44198915b3f175eddb45418d4faf7a0c92081df
parent80dd7e771167c193e94eeab05580448480cefe91 (diff)
Respect sp, vsp, tabe mappings for buffers builtin (#99)
Closes: #98
-rw-r--r--lua/telescope/actions.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/lua/telescope/actions.lua b/lua/telescope/actions.lua
index d102e0d..ae20eb4 100644
--- a/lua/telescope/actions.lua
+++ b/lua/telescope/actions.lua
@@ -91,8 +91,12 @@ local function goto_file_selection(prompt_bufnr, command)
-- TODO: Sometimes we open something with missing line numbers and stuff...
if entry_bufnr then
- a.nvim_win_set_buf(original_win_id, entry_bufnr)
- vim.api.nvim_command("doautocmd filetypedetect BufRead " .. vim.fn.fnameescape(filename))
+ if command == "e" then
+ a.nvim_win_set_buf(original_win_id, entry_bufnr)
+ vim.api.nvim_command("doautocmd filetypedetect BufRead " .. vim.fn.fnameescape(filename))
+ else
+ vim.cmd(string.format(":%s #%d", command, entry_bufnr))
+ end
else
vim.cmd(string.format(":%s %s", command, filename))