stevearc / dressing.nvim

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

fix: add space after prompt to look nicer #136

Closed 231tr0n closed 5 months ago

231tr0n commented 5 months ago

add space after prompt for fzf backend to look good

Context

Using fzf as backend, without this extra space, the prompt gets mixed with the ones we are typing making it unable to read like in the below screenshot image Even after disabling trim_prompts it looks like this which is little bit unclear to read image

Description

It adds an extra space to the prompt making it look cleaner and seperates the input from prompt making it readable like in the screenshot below

Without trim prompts enabled image With trim prompts enabled image

Test Plan

bootstrap_paq({
    {
        "junegunn/fzf",
        build = ":call fzf#install()",
    },
    "junegunn/fzf.vim",
    "nomnivore/ollama.nvim",
    "stevearc/dressing.nvim",
})

require("ollama").setup({
    model = "codellama",
    url = "http://127.0.0.1:11434",
    -- serve = {
    --  on_start = false,
    --  command = "ollama",
    --  args = { "serve" },
    --  stop_command = "pkill",
    --  stop_args = { "-SIGTERM", "ollama" },
    -- },
    prompts = {
        Sample_Prompt = {
            prompt = "This is a sample prompt that receives $input and $sel(ection), among others.",
            input_label = "> ",
            model = "codellama",
            action = "display",
        },
    },
})

require("dressing").setup({
    select = {
        backend = { "fzf", "nui", "builtin" },
        trim_prompt = false,
    },
})
stevearc commented 5 months ago

Thanks for the PR!