diff --git a/lua/telescope/builtin/files.lua b/lua/telescope/builtin/files.lua index 8b2c6f2382..29c8df5eab 100644 --- a/lua/telescope/builtin/files.lua +++ b/lua/telescope/builtin/files.lua @@ -492,6 +492,7 @@ files.current_buffer_tags = function(opts) return files.tags(vim.tbl_extend("force", { prompt_title = 'Current Buffer Tags', only_current_file = true, + path_display = 'hidden', }, opts)) end diff --git a/lua/telescope/utils.lua b/lua/telescope/utils.lua index ff7a1e6cf6..f965cc4b49 100644 --- a/lua/telescope/utils.lua +++ b/lua/telescope/utils.lua @@ -293,8 +293,16 @@ utils.transform_path = function(opts, path) if vim.tbl_contains(path_display, "tail") then transformed_path = utils.path_tail(transformed_path) else - if not vim.in_fast_event() and not vim.tbl_contains(path_display, "absolute") then - local cwd = vim.fn.expand(opts.cwd or vim.fn.getcwd()) + if not vim.tbl_contains(path_display, "absolute") then + local cwd + if opts.cwd then + cwd = opts.cwd + if not vim.in_fast_event() then + cwd = vim.fn.expand(opts.cwd) + end + else + cwd = vim.loop.cwd(); + end transformed_path = pathlib.make_relative(transformed_path, cwd) end