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: noice does not display regular messages in history

ilan-schemoul 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)

0.9.5

Operating system/version

ubuntu 22.04

Describe the bug

When I type echo "test" then :Noice I don't see it in history despite the fact my filter is set to accept everything in the commands.history

Steps To Reproduce

:echo "test"
:echoerr "err"
:Noice
(you only see err not test)

Expected Behavior

test
err

Repro

-- 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",
"MunifTanjim/nui.nvim",
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here
require('noice').setup(
{
    lsp = {
      progress = {
        enabled = false,
      },
      hover = {
        enabled = false,
      },
      signature = {
        enabled = false,
      },
    },
    messages = {
      view = "notify",
      view_error = "notify",
      enabled = true,
    },
    popupmenu = {
      enabled = false,
    },
    commands = {
      history = {
        -- options for the message history that you get with `:Noice`
        view = "split",
        opts = { enter = true, format = "details" },
        filter = {
            cond = function(_) return true end,
        },
      },
    },

    routes = {
      {
        filter = {
          event = "msg_show",
          kind = "",
          any = {

            { find = "no lines in buffer" },
            -- Edit
            { find = "%d+ less lines" },
            { find = "%d+ fewer lines" },
            { find = "%d+ more lines" },
            { find = "%d+ change;" },
            { find = "%d+ line less;" },
            { find = "%d+ more lines?;" },
            { find = "%d+ fewer lines;?" },
            { find = '".+" %d+L, %d+B' },
            { find = "%d+ lines yanked" },
            { find = "^Hunk %d+ of %d+$" },
            { find = "%d+L, %d+B$" },
            { find = "^[/?].*" }, -- Searching up/down
            { find = "E486: Pattern not found:" }, -- Searcingh not found
            { find = "%d+ changes?;" }, -- Undoing/redoing
            { find = "%d+ fewer lines" }, -- Deleting multiple lines
            { find = "%d+ more lines" }, -- Undoing deletion of multiple lines
            { find = "%d+ lines " }, -- Performing some other verb on multiple lines
            { find = "Already at newest change" }, -- Redoing
            { find = '"[^"]+" %d+L, %d+B' }, -- Saving

            -- Save
            { find = " bytes written" },

            -- Redo/Undo
            { find = " changes; before #" },
            { find = " changes; after #" },
            { find = "1 change; before #" },
            { find = "1 change; after #" },

            -- Yank
            { find = " lines yanked" },

            -- Move lines
            { find = " lines moved" },
            { find = " lines indented" },

            -- Bulk edit
            { find = " fewer lines" },
            { find = " more lines" },
            { find = "1 more line" },
            { find = "1 line less" },

            -- General messages
            { find = "Already at newest change" }, -- Redoing
            { find = "Already at oldest change" },
          },
        },
        opts = { skip = true },
      },
    },
}
)

Use case is for example if I git push I might have relevant information I need to copy paste (my git server gives me important URL I need to keep track of)

@folke this is a paint point at my current new job. I would really love if you can give me any help on that matter :) Maybe I just don't know how to config properly

I have the same issue. Until then the :messages covers my needs. ☮️

I have the same issue. Until then the :messages covers my needs. ☮️

messages is when you echomsg I wish noice could save "echo" output too (as it already captures it to show it in nvim it could also add it to history)

commented

Here is a workaround:

filter = {
    any = {
        { cond = function(_) return true end }
    },
},

The any table key is not cleared when cond is added, and I am not sure why.