diff options
| author | Lars Haalck <lars.haalck@uni-muenster.de> | 2021-04-15 15:30:56 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-15 09:30:56 -0400 |
| commit | f2c3f724ad8c05f7001eb0f091ed210f02a62ca2 (patch) | |
| tree | 499f433708214dee6beb0a0a7a967f22e2d85cad /lua | |
| parent | 9e603d3c1b947c8f063d81a3c926e216b708928f (diff) | |
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)
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/telescope/actions/set.lua | 4 |
1 files 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 |
