Change center layout strategy to allow vertical anchoring (#1719)
* Change center layout strategy to allow vertical anchoring Affects `telescope.pickers.layout_strategies.center` that is used by dropdown (`telescope.themes.get_dropdown()`) theme, allowing more customization for dropdown theme, i. e. setting it in the top with mirrored preview. For `anchor` containing `N` or `S` will ignore `mirror` config and preview will be placed as follows: - Anchoring for `N` put the preview below the prompt result block. - Anchoring for `S` put the preview above the prompt result block. - For horizontal anchoring preview will be placed according to `mirror`. * [docgen] Update doc/telescope.txt skip-checks: true Co-authored-by: Github Actions <actions@github>
This commit is contained in:
@@ -1631,11 +1631,15 @@ layout_strategies.horizontal() *layout_strategies.horizontal()*
|
||||
layout_strategies.center() *layout_strategies.center()*
|
||||
Centered layout with a combined block of the prompt and results aligned to
|
||||
the middle of the screen. The preview window is then placed in the
|
||||
remaining space above. Particularly useful for creating dropdown menus (see
|
||||
|telescope.themes| and |themes.get_dropdown()|`).
|
||||
remaining space above or below, according to `anchor` or `mirror`.
|
||||
Particularly useful for creating dropdown menus (see |telescope.themes| and
|
||||
|themes.get_dropdown()|).
|
||||
|
||||
Note that the `anchor` option can only pin this layout to the left or right
|
||||
edges.
|
||||
Note that vertical anchoring, i.e. `anchor` containing `"N"` or `"S"`, will
|
||||
override `mirror` config. For `"N"` anchoring preview will be placed below
|
||||
prompt/result block. For `"S"` anchoring preview will be placed above
|
||||
prompt/result block. For horizontal only anchoring preview will be placed
|
||||
according to `mirror` config, default is above the prompt/result block.
|
||||
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│ ┌────────────────────────────────────────┐ │
|
||||
|
||||
Reference in New Issue
Block a user