fix(make_entry): improve filename_first support (#3140)

Few pickers with entry makers that relied on `entry_display.create` were
not properly passing the highlight table returned by `transform_path`.
This made the `filename_first` `path_display` option not work as
expected for these pickers.
This commit is contained in:
James Trew
2024-05-26 21:50:31 -04:00
committed by GitHub
parent 349660c0d3
commit 4c96370cf9
2 changed files with 34 additions and 12 deletions

View File

@@ -132,12 +132,12 @@ diagnostics.get = function(opts)
if opts.bufnr ~= 0 then
opts.bufnr = nil
end
if opts.bufnr == nil then
opts.path_display = vim.F.if_nil(opts.path_display, {})
end
if type(opts.bufnr) == "string" then
opts.bufnr = tonumber(opts.bufnr)
end
if opts.bufnr ~= nil then
opts.path_display = vim.F.if_nil(opts.path_display, "hidden")
end
local locations = diagnostics_to_tbl(opts)
@@ -157,7 +157,6 @@ diagnostics.get = function(opts)
return
end
opts.path_display = vim.F.if_nil(opts.path_display, "hidden")
pickers
.new(opts, {
prompt_title = opts.bufnr == nil and "Workspace Diagnostics" or "Document Diagnostics",