nvim-colortils / colortils.nvim

Some color utils for neovim
GNU General Public License v2.0
363 stars 13 forks source link

Cursor is not properly reset on quit #20

Closed lervag closed 1 year ago

lervag commented 1 year ago

I've started to test your plugin. It looks cool and useful; thanks!

I noticed that when I quit e.g. the picker, my cursor colors have been changed. It seems this is caused by the following code:

https://github.com/nvim-colortils/colortils.nvim/blob/6e2b200dfedd67d96eafd74b08adc08da95ccb4f/lua/colortils/tools/picker.lua#L562-L569

For some reason, you use nvim_set_hl to change the "Cursor" highlight group, but you do not revert it to the old setting. I believe that is a bug. IMHO, it is a severe bug, because it changes my environment after using your plugin in a way that is not acceptable to me.

I hope there is a simple fix for this. If I could immediately see how to fix it, I would propose a PR.

lervag commented 1 year ago

Looking a bit closer, it seems the problem is here:

https://github.com/nvim-colortils/colortils.nvim/blob/6e2b200dfedd67d96eafd74b08adc08da95ccb4f/lua/colortils/tools/picker.lua#L523-L529

Perhaps you meant to have lines 528 and 529 before line 523?

lervag commented 1 year ago

For me, that seems to fix things, at least.

But, I also noticed that the code that should add bold for the current line does not seem to work for me. I fixed it by defining the Bold highlight group. But I don't think this is a standard highlight group. Perhaps it would be useful for colortils to define this with the default option (to avoid overwriting if people do define it)?

max397574 commented 1 year ago

Perhaps you meant to have lines 528 and 529 before line 523?

that's something I haven't seen thank you for that

I didn't realize that Bold isn't a default highlight group I'll fix those things when I get home

lervag commented 1 year ago

No problem; thanks for the useful plugin!

max397574 commented 1 year ago

@lervag both things should be done now if so you can close this issue

lervag commented 1 year ago

Thanks!