diff options
| author | Luke Kershaw <35707277+l-kershaw@users.noreply.github.com> | 2021-10-04 20:16:58 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-04 21:16:58 +0200 |
| commit | be600b5421c652c84f94c0c75ba6d309165ed0ef (patch) | |
| tree | e54c30e95a97bd7a1241e2695eb4c66a95347f94 /lua/telescope/themes.lua | |
| parent | e39ed31f17e35d4f42b516d10ed4340fca25eb6a (diff) | |
feat: more prompt position strategies (#1280)
* feat: allow `prompt_position` for `vertical` layout strategy
* feat: allow `prompt_position` for `bottom_pane` layout strategy
* stylua
* [docgen] Update doc/telescope.txt
skip-checks: true
* refactor: switch to `string.format`
* stylua
* feat: allow `prompt_position` for `center` layout strategy
* feat: handle user defined `prompt_position` within themes
* [docgen] Update doc/telescope.txt
skip-checks: true
* fix: tweak `center` layout
- ensure `prompt` title is visible when `prompt_position="bottom"`
* fix: refactor `center` tweak
- move title to bottom of picker when `prompt_position="bottom"`
* fix: tweak `bottom_pane` layout
* stylua
Co-authored-by: Github Actions <actions@github>
Diffstat (limited to 'lua/telescope/themes.lua')
| -rw-r--r-- | lua/telescope/themes.lua | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/lua/telescope/themes.lua b/lua/telescope/themes.lua index 5b334b1..398a842 100644 --- a/lua/telescope/themes.lua +++ b/lua/telescope/themes.lua @@ -52,6 +52,13 @@ function themes.get_dropdown(opts) preview = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" }, }, } + if opts.layout_config and opts.layout_config.prompt_position == "bottom" then + theme_opts.borderchars = { + prompt = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" }, + results = { "─", "│", "─", "│", "╭", "╮", "┤", "├" }, + preview = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" }, + } + end return vim.tbl_deep_extend("force", theme_opts, opts) end @@ -99,7 +106,7 @@ end function themes.get_ivy(opts) opts = opts or {} - return vim.tbl_deep_extend("force", { + local theme_opts = { theme = "ivy", sorting_strategy = "ascending", @@ -117,7 +124,16 @@ function themes.get_ivy(opts) results = { " " }, preview = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" }, }, - }, opts) + } + if opts.layout_config and opts.layout_config.prompt_position == "bottom" then + theme_opts.borderchars = { + prompt = { " ", " ", "─", " ", " ", " ", "─", "─" }, + results = { "─", " ", " ", " ", "─", "─", " ", " " }, + preview = { "─", " ", "─", "│", "┬", "─", "─", "╰" }, + } + end + + return vim.tbl_deep_extend("force", theme_opts, opts) end return themes |
