From 1d73f4f9c1d4e4f0eaf712b7a763bac8c8ca5a6c Mon Sep 17 00:00:00 2001 From: Sassan Haradji Date: Tue, 19 Nov 2024 07:15:50 +0400 Subject: [PATCH] refactor: expose path_truncate --- lua/telescope/utils.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/telescope/utils.lua b/lua/telescope/utils.lua index 4953e9dc8c..584f28c2ab 100644 --- a/lua/telescope/utils.lua +++ b/lua/telescope/utils.lua @@ -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 @@ -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