stevearc / dressing.nvim

Neovim plugin to improve the default vim.ui interfaces
MIT License
1.69k stars 32 forks source link

feat: add `trim_prompt` setting for `vim.ui.input` #134

Closed chrisgrieser closed 5 months ago

chrisgrieser commented 5 months ago

Give input the same trim_prompt setting select already has.

Context

What is the problem you are trying to solve?
It's really only a minor aesthetic improvement. Also makes input and select more consistent, as they both now have a trim_prompt setting.

Description

Describe how the changes add the functionality or fix the issue under "Context" The gist of it: if input.trim_only then title = title:gsub(":$", "").

Test Plan

list the steps you took to test this functionality. Steps should be reproducible by others.

confirm that it works correctly:

require("dressing").setup { input = { trim_prompt = true } }
vim.ui.input({ prompt = "Input: " }, function () end)
require("dressing").setup { input = { trim_prompt = false } }
vim.ui.input({ prompt = "Input: " }, function () end)
stevearc commented 5 months ago

LGTM thanks!