expand paths more smartly (#2599)
This commit is contained in:
@@ -15,6 +15,10 @@ local get_status = require("telescope.state").get_status
|
||||
|
||||
local utils = {}
|
||||
|
||||
utils.smart_path_expand = function(path)
|
||||
return path:match "^[%#<]" and vim.fn.expand(path) or vim.fn.fnameescape(path)
|
||||
end
|
||||
|
||||
utils.get_separator = function()
|
||||
return Path.path.sep
|
||||
end
|
||||
@@ -221,7 +225,7 @@ utils.transform_path = function(opts, path)
|
||||
if opts.cwd then
|
||||
cwd = opts.cwd
|
||||
if not vim.in_fast_event() then
|
||||
cwd = vim.fn.expand(opts.cwd)
|
||||
cwd = utils.smart_path_expand(opts.cwd)
|
||||
end
|
||||
else
|
||||
cwd = vim.loop.cwd()
|
||||
|
||||
Reference in New Issue
Block a user