summaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
authorTJ DeVries <devries.timothyj@gmail.com>2020-09-07 10:54:36 -0400
committerTJ DeVries <devries.timothyj@gmail.com>2020-09-07 10:54:36 -0400
commitc98c4917be3c9298872ed6a067a9aab31bdbfd54 (patch)
tree367ccda726c66ee1b01bf0a7ce5bde13ac092ec3 /lua
parentdffcef9470e0fff88d10a1e5b6d195980b977f4c (diff)
feat: no longer need to set minheight in window_options
Diffstat (limited to 'lua')
-rw-r--r--lua/telescope/pickers.lua7
-rw-r--r--lua/telescope/pickers/layout_strategies.lua7
2 files changed, 7 insertions, 7 deletions
diff --git a/lua/telescope/pickers.lua b/lua/telescope/pickers.lua
index 075d40b..a3cfca9 100644
--- a/lua/telescope/pickers.lua
+++ b/lua/telescope/pickers.lua
@@ -186,6 +186,13 @@ function Picker:find()
-- 3. Preview window
local popup_opts = self:get_window_options(vim.o.columns, vim.o.lines, prompt_string)
+ -- `popup.nvim` massaging so people don't have to remember minheight shenanigans
+ popup_opts.results.minheight = popup_opts.results.height
+ popup_opts.prompt.minheight = popup_opts.prompt.height
+ if popup_opts.preview then
+ popup_opts.preview.minheight = popup_opts.preview.height
+ end
+
-- TODO: Add back the borders after fixing some stuff in popup.nvim
local results_win, results_opts = popup.create('', popup_opts.results)
local results_bufnr = a.nvim_win_get_buf(results_win)
diff --git a/lua/telescope/pickers/layout_strategies.lua b/lua/telescope/pickers/layout_strategies.lua
index ff5c681..d22b8a9 100644
--- a/lua/telescope/pickers/layout_strategies.lua
+++ b/lua/telescope/pickers/layout_strategies.lua
@@ -50,13 +50,10 @@ layout_strategies.horizontal = function(self, max_columns, max_lines, prompt_tit
base_height = math.floor(max_lines * 0.8)
end
results.height = base_height
- results.minheight = results.height
prompt.height = 1
- prompt.minheight = prompt.height
if self.previewer then
preview.height = results.height + prompt.height + 2
- preview.minheight = preview.height
else
preview.height = 0
end
@@ -114,17 +111,13 @@ layout_strategies.vertical = function(self, max_columns, max_lines, prompt_title
local height_padding = 3
results.height = 10
- results.minheight = 10
prompt.height = 1
- prompt.minheight = 1
-- The last 2 * 2 is for the extra borders
if self.previewer then
preview.height = max_lines - results.height - prompt.height - 2 * 2 - height_padding * 2
- preview.minheight = preview.height
else
results.height = max_lines - prompt.height - 2 - height_padding * 2
- results.minheight = results.height
end
results.col, preview.col, prompt.col = width_padding, width_padding, width_padding