Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion doc/telescope.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2043,7 +2043,8 @@ layout_strategies.center *telescope.layout_strategies.center*
• Specifies an amount of additional padding around the anchor
• Values should be a positive integer
• height:
• How tall to make Telescope's entire layout
• Controls the height of the results window in the center layout.
• Does not control the entire layout height — setting this too high can shrink or obscure the preview window.
• See |resolver.resolve_height()|
• mirror: Flip the location of the results/prompt and preview windows
• prompt_position:
Expand Down
8 changes: 7 additions & 1 deletion lua/telescope/pickers/layout_strategies.lua
Original file line number Diff line number Diff line change
Expand Up @@ -432,8 +432,13 @@ layout_strategies.horizontal = make_documented_layout(
---
layout_strategies.center = make_documented_layout(
"center",
vim.tbl_extend("error", shared_options, {
vim.tbl_extend("force", shared_options, {
preview_cutoff = "When lines are less than this value, the preview will be disabled",
height = {
"Controls the height of the results window in the center layout.",
"Does not control the entire layout height — setting this too high can shrink or obscure the preview window.",
"See |resolver.resolve_height()|",
},
}),
function(self, max_columns, max_lines, layout_config)
local initial_options = p_window.get_initial_window_options(self)
Expand All @@ -449,6 +454,7 @@ layout_strategies.center = make_documented_layout(
local width = resolve.resolve_width(width_opt)(self, max_columns, max_lines)

-- This sets the height for the whole layout
-- Setting this too high can shrink or obscure the preview window.
local height_opt = layout_config.height
local height = resolve.resolve_height(height_opt)(self, max_columns, max_lines)

Expand Down