svampkorg / moody.nvim

A plugin for neovim which changes the colour of CursorColumn depending on mode.
MIT License
52 stars 0 forks source link

bug: Highlight disappears when changing buffers #3

Closed dvd42 closed 2 months ago

dvd42 commented 2 months ago

Did you check docs and existing issues?

Neovim version (nvim -v)

NVIM v0.11.0-dev-3335+gf69937fdb-Homebrew

Operating system/version

MacOS

Describe the bug

Thanks for this plugin! I am loving it so far. However, I am having the following problem:

Whenever I change buffers the highlight disappears until I change modes. I've attached a GIF showing this.

REC-20240726173232

Here is the config I am using:

{
    "svampkorg/moody.nvim",
    event = { "ModeChanged", "BufWinEnter", "WinEnter" },
    opts = {
        blends = {
            normal = 0.2,
            insert = 0.2,
            visual = 0.25,
            command = 0.2,
            operator = 0.2,
            replace = 0.2,
            select = 0.2,
            terminal = 0.2,
            terminal_n = 0.2,
        },
        disabled_filetypes = { "TelescopePrompt" },
        bold_nr = true,
        recording = {
            enabled = true,
            icon = "󰑋",
            -- you can set some text to surround the recording registry char with
            -- or just set one to empty to maybe have just one letter, an arrow
            -- perhaps! For example recording to q, you could have! "󰑋    q" :D
            pre_registry_text = " ",
            post_registry_text = "",
        },
      },
    },

Steps To Reproduce

See Video

Expected Behavior

It's not a big deal but I suppose the expected behaviour is for the highlight to remain when switching buffers

svampkorg commented 2 months ago

Hey! Thanks for letting me know about this. I will look into it as soon as I’m back from Holliday tomorrow! :)

svampkorg commented 2 months ago

Accidentally closed this…

svampkorg commented 2 months ago

@dvd42 I tried the same bufferline, and lualine config from your dotfiles, to see if any of those plugins would affect the way Moody works. Also tried kickstart.nvim with it's plugins, and Moody. The highlights persisted on buffer change.

Could there be other plugins you have, with events for WinEnter and BufWinEnter, which are changing the CursorLine? Or do you have any of your own autocommands on those events?

Are you changing buffer with :bn, or what's the command you are entering? The video was a little blurry here so couldn't quite see 8) If you have time, could you try running neovim with just Moody installed, and see if the highlights persist or not?

dvd42 commented 2 months ago

Hey @svampkorg thanks for looking into this.

Yes, I am changing the buffer with :bn. The only plugin I have that interacts with buffers is barbar.nvim, which I use to handle my buffers, however disabling that does not help. I have no autocommands on those events.

I can confirm that the highlight persists with a minimal config using just Moody. I'll try to find the culprit and report back. Thanks!

dvd42 commented 2 months ago

Hey @svampkorg I looked into it, it was this line I had inside one of my config files:

vim.cmd(':set winhighlight=' .. cmp.config.window.bordered().winhighlight)

Sorry for the noise and thanks for looking into it. I'll close this now