folke / noice.nvim

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

Status line components do not work #70

Closed quantum-booty closed 1 year ago

quantum-booty commented 1 year ago

Describe the bug I can't see the statusline components in lualine.

Which version of Neovim are you using? NVIM v0.9.0-dev-109-g0b71960ab

To Reproduce I used the default noice configs: require("noice").setup()

And the suggested config for lualine:

require("lualine").setup({
  sections = {
    lualine_x = {
      {
        require("noice").api.statusline.message.get_hl,
        cond = require("noice").api.statusline.message.has,
      },
      {
        require("noice").api.statusline.command.get,
        cond = require("noice").api.statusline.command.has,
        color = { fg = "#ff9e64" },
      },
      {
        require("noice").api.statusline.mode.get,
        cond = require("noice").api.statusline.mode.has,
        color = { fg = "#ff9e64" },
      },
      {
        require("noice").api.statusline.search.get,
        cond = require("noice").api.statusline.search.has,
        color = { fg = "#ff9e64" },
      },
    },
  },
})

Expected Behavior I expect to be able to see the added lualine components.

Screenshots

image

Noice Log :Noice log is empty

folke commented 1 year ago

You need to add that part to your existing lualine config.

What you're showing here, is not your lualine config at all.

quantum-booty commented 1 year ago

You need to add that part to your existing lualine config.

What you're showing here, is not your lualine config at all.

Sorry I don't quite understand, what I showed in the screenshot is my lualine config. I haven't used lualine before so I'm just putting that config in init.lua for testing purposes.

folke commented 1 year ago

But your lualaine visible in the screenshot (the line at the bottom) IS configured. And not with what you have in the screenshot. The part I mentioned on the Noice website, also isn't enough. you need to properly configure lualine yourself.

Either way, this really seems to be a lualine configuration issue. Not really realated to Noice.

Did you run PackerCompile and restart Neovim?

quantum-booty commented 1 year ago

Yes I did run PackerCompile and restart Neovim. Could you elaborate on how I could properly configure lualine?

folke commented 1 year ago

Sorry, but no. I'm not going to give support on how to use lualine. Follow the docs at https://github.com/nvim-lualine/lualine.nvim/ and once that works and you are able to customize the lualine, then get back here if the Noice components would not work.

But they will work, once your lualine config works.

quantum-booty commented 1 year ago

Just to prove by point: lualine is not visible when I comment out the config:

image

And now it is visible:

image
folke commented 1 year ago

ok, did you actually do something that should trigger any of the messages?

The statusline components won't show anything if they're empty.

Try triggering an error like :foooooooo

quantum-booty commented 1 year ago

This is what I see:

image
folke commented 1 year ago

Do you get anything when after that, doing:

:lua vim.pretty_print(require("noice").api.statusline.message.get())

quantum-booty commented 1 year ago

I get this:

image
folke commented 1 year ago

That;s what it should show. So your lualine config isn't working.

folke commented 1 year ago

Are you sure that noice has been loaded when you set up lualine?

folke commented 1 year ago

Nevermind. It must be or lualine wouldn't load I guess

quantum-booty commented 1 year ago

I've just tried your lualine config in your dotfiles (I've deleted a few bits that uses plugins that I don't have): https://github.com/folke/dot/blob/master/config/nvim/lua/plugins/lualine.lua

And this is what I'm getting:

image
folke commented 1 year ago

I think I figured it out. Noice.setup should run before lua-line, otherwise it won't work.

folke commented 1 year ago

Make sure you add module="noice" to the packer use statement of noice and do setup in the config= for noice.

quantum-booty commented 1 year ago

I added "after" in my lualine config and it worked: use { 'nvim-lualine/lualine.nvim', after = 'noice.nvim', config = [[require('config.lualine')]] }