feat: check type of path_display and warn user if wrong (#1023)
This commit is contained in:
@@ -281,11 +281,11 @@ utils.transform_path = function(opts, path)
|
||||
|
||||
if type(path_display) == "function" then
|
||||
return path_display(opts, transformed_path)
|
||||
end
|
||||
|
||||
if utils.is_path_hidden(nil, path_display) then
|
||||
elseif utils.is_path_hidden(nil, path_display) then
|
||||
return ''
|
||||
end
|
||||
|
||||
elseif type(path_display) == "table" then
|
||||
|
||||
if vim.tbl_contains(path_display, "tail") or path_display.tail then
|
||||
transformed_path = utils.path_tail(transformed_path)
|
||||
@@ -309,6 +309,11 @@ utils.transform_path = function(opts, path)
|
||||
end
|
||||
|
||||
return transformed_path
|
||||
else
|
||||
log.warn("`path_display` must be either a function or a table.",
|
||||
"See `:help telescope.defaults.path_display.")
|
||||
return transformed_path
|
||||
end
|
||||
end
|
||||
|
||||
-- local x = utils.make_default_callable(function(opts)
|
||||
|
||||
Reference in New Issue
Block a user