feat: add top down prompt position
This commit is contained in:
@@ -64,9 +64,18 @@ layout_strategies.horizontal = function(self, max_columns, max_lines, prompt_tit
|
||||
|
||||
-- TODO: Center this in the page a bit better.
|
||||
local height_padding = math.max(math.floor(0.95 * max_lines), 2)
|
||||
results.line = max_lines - height_padding
|
||||
prompt.line = results.line + results.height + 2
|
||||
preview.line = results.line
|
||||
|
||||
if self.window.prompt_position == "top" then
|
||||
prompt.line = max_lines - height_padding
|
||||
results.line = prompt.line + 3
|
||||
preview.line = prompt.line
|
||||
elseif self.window.prompt_position == "bottom" then
|
||||
results.line = max_lines - height_padding
|
||||
prompt.line = results.line + results.height + 2
|
||||
preview.line = results.line
|
||||
else
|
||||
error("Unknown prompt_position: " .. self.window.prompt_position)
|
||||
end
|
||||
|
||||
return {
|
||||
preview = preview.width > 0 and preview,
|
||||
|
||||
Reference in New Issue
Block a user