Merge pull request #212 from emmanueltouzery/telescope_extra_options

extra options for the telescope integration
This commit is contained in:
Steven Arcangeli 2023-02-04 13:30:47 -08:00 committed by GitHub
commit 1e75f6f62f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -36,14 +36,15 @@ local function aerial_picker(opts)
backend.fetch_symbols_sync(0, opts)
end
local displayer = entry_display.create({
separator = " ",
items = {
{ width = 4 },
{ width = 30 },
{ remaining = true },
},
})
local displayer = opts.displayer
or entry_display.create({
separator = " ",
items = {
{ width = 4 },
{ width = 30 },
{ remaining = true },
},
})
local function make_display(entry)
local item = entry.value
@ -60,11 +61,15 @@ local function aerial_picker(opts)
local function make_entry(item)
local name = item.name
if show_nesting then
local cur = item.parent
while cur do
name = string.format("%s.%s", cur.name, name)
cur = cur.parent
if opts.get_entry_text ~= nil then
name = opts.get_entry_text(item)
else
if show_nesting then
local cur = item.parent
while cur do
name = string.format("%s.%s", cur.name, name)
cur = cur.parent
end
end
end
return {