fix: expand/normalize paths more selectively (#2628)

(cherry picked from commit 3b8399c273)
This commit is contained in:
James Trew
2024-05-20 11:10:12 +02:00
committed by Simon Hauser
parent 48960a8164
commit d5fe96ec8a
12 changed files with 80 additions and 26 deletions
+2 -1
View File
@@ -5,6 +5,7 @@ local log = require "plenary.log"
local async = require "plenary.async"
local channel = require("plenary.async").control.channel
local utils = require "telescope.utils"
local M = {}
@@ -21,7 +22,7 @@ function AsyncJob.new(opts)
self.stderr = opts.stderr or M.NullPipe()
if opts.cwd and opts.cwd ~= "" then
self.uv_opts.cwd = vim.fn.expand(vim.fn.escape(opts.cwd, "$"))
self.uv_opts.cwd = utils.path_expand(opts.cwd)
-- this is a "illegal" hack for windows. E.g. If the git command returns `/` rather than `\` as delimiter,
-- vim.fn.expand might just end up returning an empty string. Weird
-- Because empty string is not allowed in libuv the job will not spawn. Solution is we just set it to opts.cwd