rasulomaroff / reactive.nvim

Reactivity. Right in your neovim.
Apache License 2.0
183 stars 1 forks source link

Highlight Issues #8

Closed OXY2DEV closed 6 months ago

OXY2DEV commented 6 months ago

I am having an issue with spaceport.nvim and reactive.nvim.

It appears reactive is somehow changing all the highlights from my start screen.

So this Screenshot_2024-02-02-17-13-07-396_com termux-edit

Turns into this Screenshot_2024-02-02-17-12-33-669_com termux-edit

Is there a buf_ignore for reactive?(Because the config options don't stop reactive from changing the highlights)

I have seen another issue here that seems to be a version of this but can't confirm(as another plugin indent-blankline also causes the issue which is fixed by using the ignore option.

So can we get something similar? [P.S. I already checked my plugin manager and it can't disable plugins based on buffer_type and file_type so this is the next best thing]

rasulomaroff commented 6 months ago

Hi there! There's a skip function available inside a preset spec. You can use it turn off highlights when it returns true. There's also an example in the README, look at this image:

image

If you want to configure presets added by someone else and not yourself, then you can do it during setup.

require('reactive').setup {
  configs = {
    ['yourpresetname'] = {
      skip = function() end
    }
  }
}

Please try those methods and tell me whether the issue is solved.

By the way, I'm not really sure how reactive affects those colors you mentioned. The only reason I can see is that they are linked to the colors used by reactive.

OXY2DEV commented 6 months ago

You see that's the problem.

Let me tell you what(I believe) actually is happening.

  1. When the nvim command is used an empty buffer(the default start screen) is created. Your plugin and every other plugin reads the buffer type of it(which is "").
  2. Now spaceport changes it to its own buffer and sets the file type to "spaceport".
  3. Which makes the skip property useless.

However one thing I did notice is if I call a refresh on the spaceport buffer all the colors return to their initial values(and reactive isn't working anymore(?))

Anyway, either, A) Reactive is taking all the highlights but isn't reapplying them(or it's a Neovim bug which isn't letting it apply).

or B) Spaceport highlights are added after reactive has applied its own highlights(essentially somehow overwriting them somehow).

Whatever it is, I have already lost enough brain cells trying to fix it.

OXY2DEV commented 6 months ago

I knew it.

The buftype is reported as "" to reactive and then is changed to spaceport.

The issue is fixed. I just had to change the condition from == "spaceport" to == "".

Anyway, thanks for the code snippet.