feat: Add ability to have a user defined function to format the path display (#1000)
This commit is contained in:
committed by
GitHub
parent
37a3a68a78
commit
138697980b
@@ -274,12 +274,16 @@ end
|
||||
utils.transform_path = function(opts, path)
|
||||
local path_display = utils.get_default(opts.path_display, require('telescope.config').values.path_display)
|
||||
|
||||
local transformed_path = path
|
||||
|
||||
if type(path_display) == "function" then
|
||||
return path_display(opts, transformed_path)
|
||||
end
|
||||
|
||||
if utils.is_path_hidden(nil, path_display) then
|
||||
return ''
|
||||
end
|
||||
|
||||
local transformed_path = path
|
||||
|
||||
if vim.tbl_contains(path_display, "tail") then
|
||||
transformed_path = utils.path_tail(transformed_path)
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user