summaryrefslogtreecommitdiff
path: root/lua/telescope/pickers.lua
diff options
context:
space:
mode:
authorTJ DeVries <devries.timothyj@gmail.com>2020-09-12 23:15:07 -0400
committerTJ DeVries <devries.timothyj@gmail.com>2020-09-12 23:15:10 -0400
commitebd090c0fe8a3f5acff0897d8724ac0f281db9d2 (patch)
tree92ceb719c0f6a02ce55dcc2be79d58327323de3a /lua/telescope/pickers.lua
parenta2acd607b023ab93a611677e0a3a07331f05a28d (diff)
wip: some more musings on resolving height and width
Diffstat (limited to 'lua/telescope/pickers.lua')
-rw-r--r--lua/telescope/pickers.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/lua/telescope/pickers.lua b/lua/telescope/pickers.lua
index 8ce8587..4336558 100644
--- a/lua/telescope/pickers.lua
+++ b/lua/telescope/pickers.lua
@@ -288,7 +288,6 @@ function Picker:find()
a.nvim_win_set_option(prompt_win, 'winblend', self.window.winblend)
a.nvim_win_set_option(prompt_win, 'winhl', 'Normal:TelescopeNormal')
- pcall(a.nvim_buf_set_option, prompt_bufnr, 'filetype', 'TelescopePrompt')
-- a.nvim_buf_set_option(prompt_bufnr, 'buftype', 'prompt')
-- vim.fn.prompt_setprompt(prompt_bufnr, prompt_string)
@@ -311,6 +310,7 @@ function Picker:find()
local displayed_amount = 0
local displayed_fn_amount = 0
+ -- TODO: Entry manager should have a "bulk" setter. This can prevent a lot of redraws from display
self.manager = pickers.entry_manager(
self.max_results,
vim.schedule_wrap(function(index, entry)
@@ -471,6 +471,9 @@ function Picker:find()
mappings.apply_keymap(prompt_bufnr, self.attach_mappings, default_mappings)
+ -- Do filetype last, so that users can register at the last second.
+ pcall(a.nvim_buf_set_option, prompt_bufnr, 'filetype', 'TelescopePrompt')
+
if self.default_text then
vim.api.nvim_buf_set_lines(prompt_bufnr, 0, 1, false, {self.default_text})
end