Revert "expand paths more smartly (#2599)" (#2615)

This reverts commit f52ea4061d.
This commit is contained in:
James Trew
2023-07-21 21:50:44 -04:00
committed by GitHub
parent f52ea4061d
commit 7bb2fcecdc
8 changed files with 24 additions and 30 deletions

View File

@@ -256,7 +256,7 @@ previewers.file_maker = function(filepath, bufnr, opts)
end
if opts.bufname ~= filepath then
if not vim.in_fast_event() then
filepath = utils.smart_path_expand(filepath)
filepath = vim.fn.expand(filepath)
end
vim.loop.fs_stat(filepath, function(_, stat)
if not stat then

View File

@@ -13,17 +13,17 @@ local bat_options = { "--style=plain", "--color=always", "--paging=always" }
local has_less = (vim.fn.executable "less" == 1) and conf.use_less
local get_file_stat = function(filename)
return vim.loop.fs_stat(utils.smart_path_expand(filename)) or {}
return vim.loop.fs_stat(vim.fn.expand(filename)) or {}
end
local list_dir = (function()
if vim.fn.has "win32" == 1 then
return function(dirname)
return { "cmd.exe", "/c", "dir", utils.smart_path_expand(dirname) }
return { "cmd.exe", "/c", "dir", vim.fn.expand(dirname) }
end
else
return function(dirname)
return { "ls", "-la", utils.smart_path_expand(dirname) }
return { "ls", "-la", vim.fn.expand(dirname) }
end
end
end)()
@@ -55,7 +55,7 @@ local bat_maker = function(filename, lnum, start, finish)
command,
bat_options,
"--",
utils.smart_path_expand(filename),
vim.fn.expand(filename),
}
end
@@ -74,15 +74,15 @@ local cat_maker = function(filename, _, start, _)
if has_less then
if start then
return { "less", "-RS", string.format("+%s", start), utils.smart_path_expand(filename) }
return { "less", "-RS", string.format("+%s", start), vim.fn.expand(filename) }
else
return { "less", "-RS", utils.smart_path_expand(filename) }
return { "less", "-RS", vim.fn.expand(filename) }
end
else
return {
"cat",
"--",
utils.smart_path_expand(filename),
vim.fn.expand(filename),
}
end
end