Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
laggardkernel opened this issue May 16, 2021 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@laggardkernel
Copy link

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

  • Neovim: 0.4.4
  • nvim-colorizer.lua: 36c610a
@laggardkernel laggardkernel added the bug Something isn't working label May 16, 2021
@laggardkernel laggardkernel changed the title [Bug Report] ColorizerToggle doesn't work after switch colorscheme [Bug Report] ColorizerToggle doesn't work after switching colorscheme May 16, 2021
@nyngwang
Copy link

I got the same problem. Is anybody here?

@wookayin
Copy link

See also #91.

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

@nyngwang
Copy link

nyngwang commented Apr 25, 2023

@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
Copy link

wookayin commented Apr 25, 2023

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
Copy link

nyngwang commented Apr 25, 2023

@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
Copy link

@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
Copy link

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

@Galicarnax
Copy link

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

@norcalli
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants