22 lines
532 B
Lua
Raw Normal View History

2022-10-31 11:03:36 +01:00
local pickers = require("telescope.pickers")
local finders = require("telescope.finders")
local conf = require("telescope.config").values
2024-02-08 01:14:13 +01:00
local utils = require("telescope-orgmode.utils")
2022-10-31 11:03:36 +01:00
return function(opts)
2024-02-08 01:14:13 +01:00
opts = opts or {}
2022-10-31 11:03:36 +01:00
2024-02-08 01:14:13 +01:00
pickers
.new(opts, {
prompt_title = "Search Headings",
finder = finders.new_table({
results = utils.get_entries(opts),
entry_maker = opts.entry_maker or utils.make_entry(opts),
}),
sorter = conf.generic_sorter(opts),
previewer = conf.grep_previewer(opts),
})
:find()
2022-10-31 11:03:36 +01:00
end