summaryrefslogtreecommitdiff
path: root/lua/telescope/pickers
diff options
context:
space:
mode:
authorrockerBOO <rockerboo@gmail.com>2020-10-04 16:19:56 -0400
committerrockerBOO <rockerboo@gmail.com>2020-10-04 16:19:56 -0400
commit1821eb11f17d66e01122972cc3bb5e12b68923f3 (patch)
tree15a4f4579456ab2618f273c2cc1c929a79a419c1 /lua/telescope/pickers
parenta1cab377db79019c1154d9d818bbdd7a5eea0c0e (diff)
fix: Results height configurable. Properly collapse on border = false
Diffstat (limited to 'lua/telescope/pickers')
-rw-r--r--lua/telescope/pickers/layout_strategies.lua9
1 files changed, 5 insertions, 4 deletions
diff --git a/lua/telescope/pickers/layout_strategies.lua b/lua/telescope/pickers/layout_strategies.lua
index 284636d..c3af174 100644
--- a/lua/telescope/pickers/layout_strategies.lua
+++ b/lua/telescope/pickers/layout_strategies.lua
@@ -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))