diff options
| author | Anirudh Haritas Murali <49116134+anihm136@users.noreply.github.com> | 2020-12-17 02:31:49 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-17 00:01:49 +0300 |
| commit | b5ff9de13d4b15e78e9d3433d6bf085601f62a5d (patch) | |
| tree | 0be4a77baf7a02a5c590557635bea8648529e67c /lua/telescope/make_entry.lua | |
| parent | 205790285b3e4e933ab85eee62b1b515243a40bc (diff) | |
feat: add search_dirs opt to builtin.find_files to search from multiple dirs (#237)
Diffstat (limited to 'lua/telescope/make_entry.lua')
| -rw-r--r-- | lua/telescope/make_entry.lua | 9 |
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)) |
