feat: add hide / unhide preview (#1305)

* feat: add hide / unhide preview or results and prompt

* fix edit actions while only preview window is active

* add option to start telescope without previewer -> "disable_previewer_at_startup"

* remove hide / unhide prompt and resutls, improve hide / unhide preview

* fix tests - check if popup window should be created with borders - popup.create does not support setting borderhighlight and border=false

* allow toggle preview even if preview is set to false

* reuse recalculate_layout in hide / unhide preview

* add docs to toggle preview

* check if preview window is valid window

* remove unnecessary changes

* cleanup, remove unnecessary changes

* close all previewers, refactor toggle preview code

[docgen] Update doc/telescope.txt
skip-checks: true
This commit is contained in:
johnybx
2021-11-08 18:20:17 +01:00
committed by Luke Kershaw
parent e9743620ce
commit b952c2f852
5 changed files with 134 additions and 73 deletions

View File

@@ -395,6 +395,9 @@ telescope.setup({opts}) *telescope.setup()*
Default: true
- msg_bg_fillchar: Character to fill background of unpreviewable buffers with
Default: ""
- hide_on_startup: Hide previewer when picker starts. Previewer can be toggled
with actions.toggle_preview.
Default: false
*telescope.defaults.vimgrep_arguments*
@@ -1909,6 +1912,15 @@ actions.toggle_all({prompt_bufnr}) *actions.toggle_all()*
{prompt_bufnr} (number) The prompt bufnr
actions.toggle_preview({prompt_bufnr}) *actions.toggle_preview()*
Toggle preview window.
- Note: preview window can be toggled even if preview is set to false.
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.git_create_branch({prompt_bufnr}) *actions.git_create_branch()*
Create and checkout a new git branch if it doesn't already exist