summaryrefslogtreecommitdiff
path: root/lua/telescope/make_entry.lua
diff options
context:
space:
mode:
authorfdschmidt93 <39233597+fdschmidt93@users.noreply.github.com>2021-09-01 18:17:18 +0200
committerGitHub <noreply@github.com>2021-09-01 18:17:18 +0200
commit5d37c3ea08f40d8c9d3a9ebcc72bd641d366c110 (patch)
treee66df8fe1312c38ad28ff64e0f0218b415bf18af /lua/telescope/make_entry.lua
parent67bc1dcdd6eea1915b7c397b7c02451bbdc277a0 (diff)
feat: allow caching and resuming picker (#1051)
* expose `cache_picker` in telescope.setup to configure caching, see `:h telescope.defaults.cache_picker` * add builtin.resume and builtin.pickers picker
Diffstat (limited to 'lua/telescope/make_entry.lua')
-rw-r--r--lua/telescope/make_entry.lua26
1 files changed, 26 insertions, 0 deletions
diff --git a/lua/telescope/make_entry.lua b/lua/telescope/make_entry.lua
index e2c6d45..14d5ecb 100644
--- a/lua/telescope/make_entry.lua
+++ b/lua/telescope/make_entry.lua
@@ -662,6 +662,32 @@ function make_entry.gen_from_highlights()
end
end
+function make_entry.gen_from_picker(opts)
+ local displayer = entry_display.create {
+ separator = " ",
+ items = {
+ { width = 30 },
+ { remaining = true },
+ },
+ }
+
+ local make_display = function(entry)
+ return displayer {
+ entry.value.prompt_title,
+ entry.value.default_text,
+ }
+ end
+
+ return function(entry)
+ return {
+ value = entry,
+ text = entry.prompt_title,
+ ordinal = string.format("%s %s", entry.prompt_title, utils.get_default(entry.default_text, "")),
+ display = make_display,
+ }
+ end
+end
+
function make_entry.gen_from_buffer_lines(opts)
local displayer = entry_display.create {
separator = " │ ",