From f2c3f724ad8c05f7001eb0f091ed210f02a62ca2 Mon Sep 17 00:00:00 2001 From: Lars Haalck Date: Thu, 15 Apr 2021 15:30:56 +0200 Subject: [PATCH] Fix: open files with the same name (#697) (#741) * Fix: open files with the same name (#697) * Fix: fire vim.cmd if command is not edit (#760) --- lua/telescope/actions/set.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/telescope/actions/set.lua b/lua/telescope/actions/set.lua index ea46e83..54abbfc 100644 --- a/lua/telescope/actions/set.lua +++ b/lua/telescope/actions/set.lua @@ -108,11 +108,11 @@ set.edit = function(prompt_bufnr, command) if entry_bufnr then edit_buffer(command, entry_bufnr) else - filename = path.normalize(vim.fn.fnameescape(filename), vim.loop.cwd()) -- check if we didn't pick a different buffer -- prevents restarting lsp server - if vim.api.nvim_get_current_buf() ~= vim.fn.bufnr(filename) then + if vim.api.nvim_buf_get_name(0) ~= filename or command ~= "edit" then + filename = path.normalize(vim.fn.fnameescape(filename), vim.loop.cwd()) vim.cmd(string.format("%s %s", command, filename)) end