summaryrefslogtreecommitdiff
path: root/lua/telescope/actions.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/telescope/actions.lua')
-rw-r--r--lua/telescope/actions.lua8
1 files changed, 5 insertions, 3 deletions
diff --git a/lua/telescope/actions.lua b/lua/telescope/actions.lua
index 326773d..f8c3453 100644
--- a/lua/telescope/actions.lua
+++ b/lua/telescope/actions.lua
@@ -98,10 +98,12 @@ local function goto_file_selection(prompt_bufnr, command)
vim.cmd(string.format(":%s #%d", command, entry_bufnr))
end
else
- vim.cmd(string.format(":%s %s", command, filename))
-
local bufnr = vim.api.nvim_get_current_buf()
- a.nvim_buf_set_option(bufnr, 'buflisted', true)
+ if filename ~= vim.api.nvim_buf_get_name(bufnr) then
+ vim.cmd(string.format(":%s %s", command, filename))
+ a.nvim_buf_set_option(bufnr, "buflisted", true)
+ end
+
if row and col then
local ok, err_msg = pcall(a.nvim_win_set_cursor, 0, {row, col})
if not ok then