MunifTanjim / nui.nvim

UI Component Library for Neovim.
MIT License
1.62k stars 57 forks source link

solid border inconsistent with nvim_open_win #351

Closed anuramat closed 7 months ago

anuramat commented 7 months ago

float border with border set to 'solid' is an actual solid block and not background-colored padding, which is inconsistent with eg :h nvim_open_win:

• "solid": Adds padding by a single whitespace cell.

is there any hope of moving this behaviour to something like "block"? or maybe at least making the original behaviour possible under a different name?

MunifTanjim commented 7 months ago

Can you provide a code example of how to reproduce it?

anuramat commented 7 months ago

you can see how the solid border is defined in lua/nui/popup/border.lua:253 I encountered this while using noice.nvim, here's the config:

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
    vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
    vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
    "folke/tokyonight.nvim",
    {
        "folke/noice.nvim",
        dependencies = {
            "MunifTanjim/nui.nvim",
            "rcarriga/nvim-notify",
        },
        opts = function()
            return {
                lsp = {
                    hover = { enabled = true, opts = { border = "solid" } }, -- off because it fucks up the border color
                },
            }
        end,
    },
    {
        "neovim/nvim-lspconfig",
        event = { "BufReadPre", "BufNewFile" },
        config = function()
            local lspconfig = require("lspconfig")
            vim.keymap.set("n", "K", vim.lsp.buf.hover, { buffer = buffer })
            lspconfig.lua_ls.setup({})
        end,
    },
}
require("lazy").setup(plugins, {
    root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here
MunifTanjim commented 7 months ago

I'm not sure how to repro it with your provided config. I'm not really faimilar with noice.nvim.