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>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user