norcalli / nvim-colorizer.lua

The fastest Neovim colorizer.
Other
2.23k stars 117 forks source link

[Bug Report] ColorizerToggle doesn't work after switching colorscheme #61

Open laggardkernel opened 3 years ago

laggardkernel commented 3 years ago

Describe the bug I'm using the vim-one colorscheme. Just found after switching background from light to dark, the color highlight is lost.

Command ColorizerToggle works well before changing the background value, but not after that.

Environments

nyngwang commented 2 years ago

I got the same problem. Is anybody here?

wookayin commented 1 year ago

See also #91.

This repo seems no longer maintained; use this fork instead: https://github.com/NvChad/nvim-colorizer.lua

nyngwang commented 1 year ago

@wookayin I would like to know about your choice between that maintained fork and this one I'm using. (I found the latter after my last reply. It currently has some trouble regarding large files)

update: Oh sorry, I must be blind in that it is clearly documented there and I didn't see it.

wookayin commented 1 year ago

NvChad's one seems much better and well supported (and more community users). I quickly tried the one you pointed (nvim-highlight-colors) but I find that quite buggy, and I think nvim-colorizer.lua is a superset in terms of features and functionalities.

nyngwang commented 1 year ago

@wookayin But I just tried the one maintained by NvChad, which unfortunately seems buggy regarding the toggle ColorizerToggle. After toggling it off, it's impossible (at least on my machine) to re-enable it using either ColorizerToggle again or ColorizerAttachToBuffer.

This is the code I'm using for your reference:

  -- use {
  --   'NvChad/nvim-colorizer.lua',
  --   config = function ()
  --     require('colorizer').setup {
  --       user_default_options = {
  --         names = false,
  --         css_fn = true, -- Enable all CSS functions: rgb_fn, hsl_fn
  --       }
  --     }
  --     vim.keymap.set('n', '<Leader>ah', function () vim.cmd('ColorizerToggle') end)
  --     -- vim.api.nvim_create_autocmd({ 'ColorScheme' }, {
  --     --   pattern = '*',
  --     --   callback = function () vim.cmd('HighlightColorsOn') end
  --     -- })
  --   end
  -- }
  use {
    'brenoprata10/nvim-highlight-colors',
    config = function ()
      require('nvim-highlight-colors').setup {
        render = 'background',
        enable_named_colors = true,
        enable_tailwind = false
      }
      vim.keymap.set('n', '<Leader>ah', function () vim.cmd('HighlightColorsToggle') end)
      vim.api.nvim_create_autocmd({ 'ColorScheme' }, {
        pattern = '*',
        callback = function () vim.cmd('HighlightColorsOn') end
      })
    end
  }
brenoprata10 commented 1 year ago

@wookayin I would like to know about your choice between that maintained fork and this one I'm using. (I found the latter after my last reply. It currently has some trouble regarding large files)

update: Oh sorry, I must be blind in that it is clearly documented there and I didn't see it.

Just to clarify, my plugin (nvim-highlight-colors) is not a fork, I built it from scratch 😄

nyngwang commented 1 year ago

@brenoprata10 No worries, I meant NvChad one when I wrote "that maintained fork".

Galicarnax commented 1 month ago

Experiencing same issue. But I see recent (2 m.o.) activity in this repo, is it really unmaintained?

norcalli commented 1 month ago

Sorry just woke up from a metaphorical coma. I'll take a peek at reproducing this. Hopefully it's an easy fix.