Skip to content

Commit

Permalink
refactor: expose path_truncate
Browse files Browse the repository at this point in the history
  • Loading branch information
sassanh committed Nov 19, 2024
1 parent 85922dd commit 1d73f4f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/telescope/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ local calc_result_length = function(truncate_len)
return type(truncate_len) == "number" and len - truncate_len or len
end

local path_truncate = function(path, truncate_len, opts)
utils.path_truncate = function(path, truncate_len, opts)
if opts.__length == nil then
opts.__length = calc_result_length(truncate_len)
end
Expand Down Expand Up @@ -404,7 +404,7 @@ utils.transform_path = function(opts, path)
end

if vim.tbl_contains(path_display, "truncate") or path_display.truncate then
transformed_path = path_truncate(transformed_path, path_display.truncate, opts)
transformed_path = utils.path_truncate(transformed_path, path_display.truncate, opts)
end

if vim.tbl_contains(path_display, "filename_first") or path_display["filename_first"] ~= nil then
Expand Down

0 comments on commit 1d73f4f

Please sign in to comment.