refactor: move from telescope.path to plenary.path (#473)

This will deprecate telescope.path, we will remove it soon. Please move over to plenary.path

Co-authored-by: Simon Hauser <Simon-Hauser@outlook.de>
This commit is contained in:
anott03
2021-07-14 13:25:00 -04:00
committed by GitHub
parent a4896e5ef3
commit df579bac42
11 changed files with 100 additions and 69 deletions

View File

@@ -13,7 +13,7 @@
local a = vim.api
local log = require('telescope.log')
local path = require('telescope.path')
local Path = require('plenary.path')
local state = require('telescope.state')
local action_state = require('telescope.actions.state')
@@ -130,7 +130,7 @@ action_set.edit = function(prompt_bufnr, command)
-- check if we didn't pick a different buffer
-- prevents restarting lsp server
if vim.api.nvim_buf_get_name(0) ~= filename or command ~= "edit" then
filename = path.normalize(vim.fn.fnameescape(filename), vim.loop.cwd())
filename = Path:new(vim.fn.fnameescape(filename)):normalize(vim.loop.cwd())
vim.cmd(string.format("%s %s", command, filename))
end
end