From b5ff9de13d4b15e78e9d3433d6bf085601f62a5d Mon Sep 17 00:00:00 2001 From: Anirudh Haritas Murali <49116134+anihm136@users.noreply.github.com> Date: Thu, 17 Dec 2020 02:31:49 +0530 Subject: feat: add search_dirs opt to builtin.find_files to search from multiple dirs (#237) --- lua/telescope/make_entry.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lua/telescope/make_entry.lua') 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)) -- cgit v1.2.3