Merge pull request #41 from axieax/trim-prompt-colon
feat: trim trailing colon from prompt
This commit is contained in:
commit
0087ad7f7d
|
@ -165,6 +165,9 @@ require('dressing').setup({
|
|||
-- Priority list of preferred vim.select implementations
|
||||
backend = { "telescope", "fzf_lua", "fzf", "builtin", "nui" },
|
||||
|
||||
-- Trim trailing `:` from prompt
|
||||
trim_prompt = true,
|
||||
|
||||
-- Options for telescope selector
|
||||
-- These are passed into the telescope picker directly. Can be used like:
|
||||
-- telescope = require('telescope.themes').get_ivy({...})
|
||||
|
|
|
@ -47,6 +47,9 @@ local default_config = {
|
|||
-- Priority list of preferred vim.select implementations
|
||||
backend = { "telescope", "fzf_lua", "fzf", "builtin", "nui" },
|
||||
|
||||
-- Trim trailing `:` from prompt
|
||||
trim_prompt = true,
|
||||
|
||||
-- Options for telescope selector
|
||||
-- These are passed into the telescope picker directly. Can be used like:
|
||||
-- telescope = require('telescope.themes').get_ivy({...})
|
||||
|
|
|
@ -36,6 +36,10 @@ return vim.schedule_wrap(function(items, opts, on_choice)
|
|||
end
|
||||
|
||||
opts.prompt = opts.prompt or "Select one of:"
|
||||
if config.trim_prompt and opts.prompt:sub(-1, -1) == ":" then
|
||||
opts.prompt = opts.prompt:sub(1, -2)
|
||||
end
|
||||
|
||||
local format_override = config.format_item_override[opts.kind]
|
||||
if format_override then
|
||||
opts.format_item = format_override
|
||||
|
|
Loading…
Reference in New Issue