folke / noice.nvim

💥 Highly experimental plugin that completely replaces the UI for messages, cmdline and the popupmenu.
Apache License 2.0
4.29k stars 100 forks source link

bug: Format pattern for searching not working as expected #823

Closed JustinBacher closed 4 months ago

JustinBacher commented 4 months ago

Did you check docs and existing issues?

Neovim version (nvim -v)

0.10.0

Operating system/version

Arch Linux

Describe the bug

I assume using the default setup that noice would show an icon for search/replace but it isn't.

/ image

: (just entering the cmdline) image

:%s/ image

:%s/abc image

I have tried setting up with defaults and I have tried adding my own replace pattern. As in the seen in my reproducable example, I tested using nvim -u repro.lua and still not showing icon for replace so I don't think it's any of my plugins but I could be wrong

Steps To Reproduce

  1. Setup using default, or use custom replace formatting
  2. Open cmdline
  3. type: %s/

Expected Behavior

For cmdline format to show the correct icon when entering search/replace

Repro

local root = vim.fn.fnamemodify("./.repro", ":p")

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

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",
    opts = {
      cmdline = {
        format = {
          replace = { pattern = "^:%s/", icon = "", lang = "vim" }
        }
      }
    }
  }
}

require("lazy").setup(plugins, { root = root .. "/plugins"})

vim.cmd.colorscheme("tokyonight")