neanias / everforest-nvim

A Lua port of the Everforest colour scheme
233 stars 15 forks source link

Neovim 0.10 compatibility #24

Closed Susensio closed 3 months ago

Susensio commented 3 months ago

It appears that neovim 0.10 did something about highlight groups https://github.com/neovim/neovim/blob/42aa69b076cb338e20b5b4656771f1873e8930d8/runtime/doc/news-0.10.txt#L25-L36

• This also might result into some color schemes looking differently due
  to them relying on implicit assumptions about how highlight groups are
  defined by default. To account for this, define all attributes of
  highlight groups explicitly. Alternatively, use `:colorscheme vim` or
  `:source $VIMRUNTIME/colors/vim.lua` to restore previous definitions.

and this has caused some issues https://github.com/neovim/novim/issues/29013

For my usecase, mini.diff was not using the right colors in sign column because:

  1. MiniDiff highlight groups are not defined in everforest https://github.com/neanias/everforest-nvim/blob/ed4ba26c911696d69cfda26014ec740861d324e1/lua/everforest/highlights.lua#L1298
  2. mini.diff falls back to Added instead of GitAdded in neovim >= 0.10 https://github.com/echasnovski/mini.diff/blob/441975a43bbec22442a91fe2ab1c7c06984e4d8a/lua/mini/diff.lua#L1005-L1007

I've solved by linking the new highlights, but maybe there is a better solution

    hl.Added = { link ="DiffAdded" }
    hl.Changed = { link ="DiffChanged" }
    hl.Removed = { link ="DiffRemoved" }
neanias commented 3 months ago

Thanks for this report! I've added the Added/Changed/Removed highlights as well as the MiniDiff* highlights. It should be ok in the future as a result!