fix: Results height configurable. Properly collapse on border = false

This commit is contained in:
rockerBOO
2020-10-04 16:19:56 -04:00
parent a1cab377db
commit 1821eb11f1
4 changed files with 16 additions and 8 deletions

View File

@@ -123,7 +123,6 @@ end
+--------------+
--]]
-- Check if there are any borders. Right now it's a little raw as
@@ -138,9 +137,11 @@ layout_strategies.center = function(self, columns, lines, prompt_title)
local results = initial_options.results
local prompt = initial_options.prompt
local max_results = 15
local width = resolve.resolve_width(self.window.width)(self, columns)
-- This sets the height/width for the whole layout
local height = resolve.resolve_height(self.window.results_height)(self, lines)
local width = resolve.resolve_width(self.window.results_width)(self, columns)
local max_results = (height > lines and lines or height)
local max_width = (width > columns and columns or width)
prompt.height = 1
@@ -157,7 +158,7 @@ layout_strategies.center = function(self, columns, lines, prompt_title)
end
prompt.line = (lines / 2) - ((max_results + (bs * 2)) / 2)
results.line = prompt.line + 2
results.line = prompt.line + 1 + (bs)
preview.line = 1
preview.height = math.floor(prompt.line - (2 + bs))