Skip to content

Commit d059ee7

Browse files
authored
docs: clarify that center layout height controls results window, not full layout (#3661)
1 parent ec00961 commit d059ee7

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

doc/telescope.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2043,7 +2043,8 @@ layout_strategies.center *telescope.layout_strategies.center*
20432043
• Specifies an amount of additional padding around the anchor
20442044
• Values should be a positive integer
20452045
• height:
2046-
• How tall to make Telescope's entire layout
2046+
• Controls the height of the results window in the center layout.
2047+
• Does not control the entire layout height — setting this too high can shrink or obscure the preview window.
20472048
• See |resolver.resolve_height()|
20482049
• mirror: Flip the location of the results/prompt and preview windows
20492050
• prompt_position:

lua/telescope/pickers/layout_strategies.lua

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,8 +432,13 @@ layout_strategies.horizontal = make_documented_layout(
432432
---
433433
layout_strategies.center = make_documented_layout(
434434
"center",
435-
vim.tbl_extend("error", shared_options, {
435+
vim.tbl_extend("force", shared_options, {
436436
preview_cutoff = "When lines are less than this value, the preview will be disabled",
437+
height = {
438+
"Controls the height of the results window in the center layout.",
439+
"Does not control the entire layout height — setting this too high can shrink or obscure the preview window.",
440+
"See |resolver.resolve_height()|",
441+
},
437442
}),
438443
function(self, max_columns, max_lines, layout_config)
439444
local initial_options = p_window.get_initial_window_options(self)
@@ -449,6 +454,7 @@ layout_strategies.center = make_documented_layout(
449454
local width = resolve.resolve_width(width_opt)(self, max_columns, max_lines)
450455

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

0 commit comments

Comments
 (0)