mvllow / modes.nvim

Prismatic line decorations for the adventurous vim user

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Highlights get overwritten all the time

weilbith opened this issue Β· comments

Hey πŸ‘‹πŸΎ

in your README you advertise the option to define the highlights directly in a traditional way without hex color values in the setup function call. I like that. The problem: it doesn't work. I looked into the code and you actually redefine the highlights very time the mode changes. That makes it impossible to set them as user. I set the highlight, the plugins overwrites them.

A very simple but effective solution would be to add the default argument (:help :highlight-default).
But honestly I'm not sure if redefining the highlight over and over and over again makes actually sense. I mean why? Isn't it also performance threatening? Setting a highlight causes a couple of more actions by NeoVim in background.

Looking forward to discuss this. Maybe you actually have a very good reason to do it like that. I'm open to make a PR myself.

commented

Ciao!

in your README you advertise the option to define the highlights directly in a traditional way without hex color values in the setup function call

This was meant for themes, which may or not be relevant. If setting the highlights this way in your neovim config, you may need to set them in an autocmd – similar to overwriting theme values.

I'm not sure if redefining the highlight over and over and over again makes actually sense. I mean why?

This is simply due to my lack of neovim/lua knowledge. I would love to not set the highlights multiple times and will explore ways to avoid this.

Appreciate the feedback; This plugin has (relatively) gained popularity recently and in turn there are more minds contributing ideas and improvements and I plan on working through those now 😌

How about using virtual line ?

commented

How about using virtual line ?

This would simplify the cursorline aspect. Definitely worth exploring 😌

I assume that wouldn't interfere with other virtual text such as diagnostics

Using a virtual line is a nice idea. But honestly it has nothing to do with this issue here.

This was meant for themes, which may or not be relevant.

That doesn't matter. Themes are just a collection of highlight commands.

commented

That doesn't matter. Themes are just a collection of highlight commands.

The ordering does matter, though. If you use the highlight groups as a user you will need to use an autocmd similar to overwriting any theme.

commented

Going to close this but please feel free to start a PR if anyone has improvements – I personally don't have a solution in mind