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

Commit `4afd483` breaks the color picker of ccc.nvim #183

Closed chrisgrieser closed 7 months ago

chrisgrieser commented 7 months ago

Neovim version (nvim -v | head -n1)

NVIM v0.9.4

Operating system/version

macOS 14.1 (M1)

How to reproduce the issue

Using this minimal config:

for _, name in ipairs { "config", "data", "state", "cache" } do
    vim.env[("XDG_%s_HOME"):format(name:upper())] = "/tmp/nvim-debug/" .. name
end

--------------------------------------------------------------------------------

local plugins = {
    {
        "kevinhwang91/nvim-ufo",
        dependencies = "kevinhwang91/promise-async",
        commit = "4afd483", -- this commit introduced the bug
        -- commit = "068053c", -- this commit is still fine
        opts = true,
    },
    {
        "uga-rosa/ccc.nvim",
        init = function() vim.opt.termguicolors = true end,
    },
}

--------------------------------------------------------------------------------

local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
    vim.fn.system {
        "git",
        "clone",
        "--filter=blob:none",
        "https://github.com/folke/lazy.nvim.git",
        "--branch=stable",
        lazypath,
    }
end
vim.opt.runtimepath:prepend(lazypath)
require("lazy").setup(plugins)
  1. Open a file with the config.
  2. type something like local color = "#fff222"
  3. Move the cursor to the color and run :CccPick

Expected behavior

Colors in the color picker should be displayed like this. (This is commit 068053c and before) Pasted image 2023-11-26 at 12 59 19@2x

Actual behavior

The colors in the color picker are broken. This is the case since commit 4afd483.

Pasted image 2023-11-26 at 12 58 03@2x


Nothing else is broken, it is only this interaction between ufo and ccc. Since the break occurred due to a commit from ufo, I am suspecting that the problem lies on ufo's side rather than on ccc's side. (Nonetheless, I will also open a bug report at the ccc repo.)

kevinhwang91 commented 7 months ago

Fix now, no idea why setl winhl-=CursorLine:UfoCursorFoldedLine clear ccc.nvim highlight.

chrisgrieser commented 7 months ago

thanks for the quick fix!