folke / noice.nvim

💥 Highly experimental plugin that completely replaces the UI for messages, cmdline and the popupmenu.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bug: broken if nvim-notify set wrapped-compact + icons

fcying opened this issue · comments

Did you check docs and existing issues?

  • I have read all the noice.nvim docs
  • I have searched the existing issues of noice.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

NVIM v0.9.5

Operating system/version

debian 12

Describe the bug

When I use noice, if I configure the ptions of nvim-notify: render = "wrapped-compact" and icons, it will crash.
only set render = "wrapped-compact" is fine.
Directly using nvim-notify is fine.
PixPin_2024-01-28_18-07-13

Steps To Reproduce

  1. nvim -u repro.lua
  2. echo "t"

Expected Behavior

work fine

Repro

local g, fn = vim.g, vim.fn
g.config_dir = fn.fnamemodify(fn.resolve(fn.expand('<sfile>:p')), ':h')
g.runtime_dir = g.config_dir .. "/.repro"
for _, name in ipairs({ "config", "data", "state", "cache" }) do
    vim.env[("XDG_%s_HOME"):format(name:upper())] = g.runtime_dir .. "/" .. name
end

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

local plugins = {
    "folke/tokyonight.nvim",
    {
        "nvim-treesitter/nvim-treesitter",
        build = ":TSUpdate",
        config = function()
            local parser_install_dir = g.runtime_dir .. "/parsers"
            vim.opt.runtimepath:prepend(parser_install_dir)
            require("nvim-treesitter.configs").setup {
                parser_install_dir = parser_install_dir,
                ensure_installed = { "lua", "vim", "regex", "bash", "markdown", "markdown_inline" },
            }
        end
    },
    {
        "rcarriga/nvim-notify",
        config = function()
            require("notify").setup({
                render = "wrapped-compact",
                max_width = 100,
                icons = {
                    ERROR = "[E]",
                    WARN  = "[W]",
                    INFO  = "[I]",
                    DEBUG = "[D]",
                    TRACE = "[T]",
                },
            })
            --vim.notify = require("notify")
        end
    },
    {
        "folke/noice.nvim",
        opts = {
            lsp = {
                override = {
                    ["vim.lsp.util.convert_input_to_markdown_lines"] = true,
                    ["vim.lsp.util.stylize_markdown"] = true,
                    ["cmp.entry.get_documentation"] = true,
                },
            },
            presets = {
                bottom_search = true,
                command_palette = false,
                long_message_to_split = true,
                inc_rename = true,
            },
        },
        dependencies = {
            { "MunifTanjim/nui.nvim" },
        }
    },
}

vim.opt.termguicolors = true
require("lazy").setup(plugins, {
    root = g.runtime_dir .. "/plugins",
})
vim.cmd.colorscheme("tokyonight")