stevearc / dressing.nvim

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

feat: allow passing `footer` in input and select with builtin backend #160

Closed chrisgrieser closed 3 months ago

chrisgrieser commented 4 months ago

For input and select (with the builtin backend), add support for adding a footer via the opts of vim.ui.input and vim.ui.select, for example:

vim.ui.input({
    prompt = "Hello World",
    footer = "foobar",
}, function(text) print(text) end)

Context

What is the problem you are trying to solve? Increase customizability.

Test Plan

list the steps you took to test this functionality. Steps should be reproducible by others. I ran the code block above.

chrisgrieser commented 3 months ago

Hmmm, true, you make a good point, I haven't thought far enough ahead here. I agree, the long-term compatibility with vim.ui is more relevant here than this

chrisgrieser commented 3 months ago

I just realized that from the plugin author side, it's actually not a problem anyway, as I discovered that you can change things like window options after window creation via nvim_win_set_config().

Just as a FYI/showcase, in tinygit, my git plugin that uses dressing for all its UI, I added a character count in the footer, since it's quite helpful to see whether your commit message has overlength.

Pasted image 2024-06-07 at 11 50 18@2x