kevinhwang91 / nvim-ufo

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

Color picker from ccc.nvim does not show colors with UFO loaded #111

Closed Mange closed 1 year ago

Mange commented 1 year ago

Neovim version (nvim -v | head -n1)

NVIM v0.9.0-dev-721+g2093e574c6

Operating system/version

Linux 6.1.6-arch1-1 #1 SMP PREEMPT_DYNAMIC Sat, 14 Jan 2023 13:09:35 +0000

How to reproduce the issue

cat ~/ccc-repro.vim

set termguicolors

let s:plug_dir = expand('/tmp/plugged/vim-plug')
if !filereadable(s:plug_dir .. '/autoload/plug.vim')
  execute printf('!curl -fLo %s/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim', s:plug_dir)
end

execute 'set runtimepath+=' . s:plug_dir
call plug#begin(s:plug_dir)
Plug 'uga-rosa/ccc.nvim'
Plug 'kevinhwang91/promise-async'
Plug 'kevinhwang91/nvim-ufo'
call plug#end()
PlugInstall | quit

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

require("ccc").setup({})
require("ufo").setup({})
EOF

nmap <space> :CccPick<CR>
nvim -u ~/ccc-repro.vim

Let it install plugins. Restart nvim with the same command.

Now, press Space to open the color picker.

Expected behavior

The color picker should display colored bars. Moving left, right, up, down using hjkl should change the bar colors and the preview below.

image

Actual behavior

The colored bars are not colored, and the resulting preview at the bottom is not highlighted either.

image

While popup is open, run :UfoDetach, and close the popup with q. Then open it again with Space and the colors now work.

kevinhwang91 commented 1 year ago

Look like nvim_win_set_hl_ns issue caused by setl winhl-=CursorLine:UfoCursorFoldedLine

Mange commented 1 year ago

That was fast! Thank you.

I can confirm that it's all working for me now. :heart: