kevinhwang91 / nvim-ufo

Not UFO in the sky, but an ultra fold in Neovim.
BSD 3-Clause "New" or "Revised" License
2.16k stars 37 forks source link

UfoFoldedFg and UfoFoldedBg color setting not working #220

Closed chunxuan-hs closed 1 month ago

chunxuan-hs commented 1 month ago

Neovim version (nvim -v | head -n1)

nvim 0.9.4

Operating system/version

macos 13

How to reproduce the issue

Could not change the color of highlight group.

Codes to change the color

hi UfoFoldedBg guibg=#f43753

Basic config

lua << EOF
vim.o.foldcolumn = '1'
vim.o.foldlevel = 99 
vim.o.foldlevelstart = 99
vim.o.foldenable = true

require('ufo').setup({
  open_fold_hl_timeout = 0 
})

vim.keymap.set('n', 'zR', require('ufo').openAllFolds)
vim.keymap.set('n', 'zM', require('ufo').closeAllFolds)
-- vim.keymap.set('n', 'zr', require('ufo').openFoldsExceptKinds)
-- vim.keymap.set('n', 'zm', require('ufo').closeFoldsWith)
EOF

Expected behavior

The color do not change:

Screenshot 2024-05-13 at 11 13 15

However, it seems the UfoFoldedBg has been set correctly.

Screenshot 2024-05-13 at 11 23 22

Actual behavior

Expect a different highligh color for the folded line.

Many thanks!

kevinhwang91 commented 1 month ago

https://github.com/kevinhwang91/nvim-ufo/blob/65dda6360879f6ffe0278163b9192a573a0d2a08/lua/ufo/highlight.lua#L35-L54