Skip to content

Commit

Permalink
hide path for buffer tags picker and cleanup expand logic for
Browse files Browse the repository at this point in the history
transform_path
  • Loading branch information
caojoshua committed Jun 15, 2021
1 parent 9ffbea7 commit 6d96739
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions lua/telescope/builtin/files.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 10 additions & 2 deletions lua/telescope/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 6d96739

Please sign in to comment.