summaryrefslogtreecommitdiff
path: root/lua/telescope/themes.lua
diff options
context:
space:
mode:
authorTJ DeVries <devries.timothyj@gmail.com>2021-07-01 02:41:58 -0700
committerGitHub <noreply@github.com>2021-07-01 05:41:58 -0400
commit5a53ec5c2fdab10ca8775d3979b1a85e63d57953 (patch)
tree40c62f0a260a3328c3b5578c06a729b76d36d5cb /lua/telescope/themes.lua
parente5bd4963da81b5d044749ee4507061801aeb0f78 (diff)
feat: Consistent and sensible layout_config (#922)
* feat: Consistent and sensible layout_config * [docgen] Update doc/telescope.txt skip-checks: true * [WIP]: Thu 17 Jun 2021 03:36:44 PM EDT * [WIP]: Thu 17 Jun 2021 03:38:11 PM EDT * layout_default -> layout_defaults * remove options from bug repot * Conni2461 suggestions: part 1 * [docgen] Update doc/telescope.txt skip-checks: true * Conni2461 suggestions: part 2 * [docgen] Update doc/telescope.txt skip-checks: true * Linting * Improve deprecation checks - Move `layout_defaults` handling to `deprecated.lua` - Check for "layout keys" outside of `layout_config` on `setup` * fixup: Just add a few more words Co-authored-by: Luke Kershaw <35707277+l-kershaw@users.noreply.github.com> Co-authored-by: Github Actions <actions@github>
Diffstat (limited to 'lua/telescope/themes.lua')
-rw-r--r--lua/telescope/themes.lua22
1 files changed, 16 insertions, 6 deletions
diff --git a/lua/telescope/themes.lua b/lua/telescope/themes.lua
index f2af1a7..939f79a 100644
--- a/lua/telescope/themes.lua
+++ b/lua/telescope/themes.lua
@@ -27,16 +27,26 @@ function themes.get_dropdown(opts)
opts = opts or {}
local theme_opts = {
- -- WIP: Decide on keeping these names or not.
theme = "dropdown",
- sorting_strategy = "ascending",
- layout_strategy = "center",
results_title = false,
preview_title = "Preview",
- preview_cutoff = 1, -- Preview should always show (unless previewer = false)
- width = 80,
- results_height = 15,
+
+ sorting_strategy = "ascending",
+ layout_strategy = "center",
+ layout_config = {
+ preview_cutoff = 1, -- Preview should always show (unless previewer = false)
+
+ width = function(_, max_columns, _)
+ return math.min(max_columns - 3, 80)
+ end,
+
+ height = function(_, _, max_lines)
+ return math.min(max_lines - 4, 15)
+ end,
+ },
+
+ border = true,
borderchars = {
{ "─", "│", "─", "│", "╭", "╮", "╯", "╰"},
prompt = {"─", "│", " ", "│", "╭", "╮", "│", "│"},