summaryrefslogtreecommitdiff
path: root/lua/telescope/make_entry.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/telescope/make_entry.lua')
-rw-r--r--lua/telescope/make_entry.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/lua/telescope/make_entry.lua b/lua/telescope/make_entry.lua
index 0a12764..04d5f3d 100644
--- a/lua/telescope/make_entry.lua
+++ b/lua/telescope/make_entry.lua
@@ -77,7 +77,8 @@ do
mt_file_entry.cwd = cwd
mt_file_entry.display = function(entry)
- local display, hl_group = entry.value
+ local hl_group
+ local display = path.make_relative(entry.value, cwd)
if shorten_path then
display = utils.path_shorten(display)
end
@@ -96,7 +97,11 @@ do
if raw then return raw end
if k == "path" then
- return t.cwd .. path.separator .. t.value
+ local retpath = t.cwd .. path.separator .. t.value
+ if not vim.loop.fs_access(retpath, "R", nil) then
+ retpath = t.value
+ end
+ return retpath
end
return rawget(t, rawget(lookup_keys, k))