diff --git a/doc/telescope.txt b/doc/telescope.txt index 47410ee8ba..cbcfb678bd 100644 --- a/doc/telescope.txt +++ b/doc/telescope.txt @@ -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: diff --git a/lua/telescope/pickers/layout_strategies.lua b/lua/telescope/pickers/layout_strategies.lua index 989c793404..2bf23efea7 100644 --- a/lua/telescope/pickers/layout_strategies.lua +++ b/lua/telescope/pickers/layout_strategies.lua @@ -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) @@ -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)