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: Nothing but hex colors works #74

Open
lucassperez opened this issue Mar 13, 2024 · 0 comments
Open

Bug: Nothing but hex colors works #74

lucassperez opened this issue Mar 13, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@lucassperez
Copy link

lucassperez commented Mar 13, 2024

Describe the bug
Only hex codes in the form of #abcdef, #abc and #abcdef00 are working.

To Reproduce
I replaced my whole neovim configuration for this:

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', -- latest stable release
    lazypath,
  })
end
vim.opt.rtp:prepend(lazypath)

local ok, lazy = pcall(require, 'lazy')
if not ok then
  vim.notify('Could not require lazy!', vim.log.levels.ERROR)
  vim.notify('Exiting from plugins/init.lua', vim.log.levels.ERROR)
  return
end

lazy.setup({
  {
    'NvChad/nvim-colorizer.lua',
    cmd = {
      'ColorizerToggle',
      'ColorizerAttachToBuffer',
      'ColorizerDetachFromBuffer',
      'ColorizerReloadAllBuffers',
    },
    config = function()
      vim.opt.termguicolors = true
      require('colorizer').setup({
        filetypes = { 'conf' },
        user_default_options = {
          -- foreground, background,  virtualtext
          mode = 'background',

          names = true,
          RGB = true, -- #RGB hex codes
          RRGGBB = true, -- #RRGGBB hex codes
          RRGGBBAA = true, -- #RRGGBBAA hex codes
          AARRGGBB = true, -- 0xAARRGGBB hex codes
          rgb_fn = true, -- CSS rgb() and rgba() functions
          hsl_fn = true, -- CSS hsl() and hsla() functions
          css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
          css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn
          -- Available methods are false / true / "normal" / "lsp" / "both"
          -- True is same as normal
          tailwind = true, -- Enable tailwind colors
          -- parsers can contain values used in |user_default_options|
          sass = { enable = true, parsers = { 'css' } }, -- Enable sass colors
          virtualtext = '■',
        },
      })
    end,
  },
})

Expected behavior
When I open a file with things like rgb(123456), I expected it to be colored.

Screenshots
If applicable, add screenshots to help explain your problem.

Operating System:
Fedora 39

Neovim Version:
0.9.5

Colorizer Version:
85855b3

Here is a screenshot of a file I'm editing:

image

@lucassperez lucassperez added the bug Something isn't working label Mar 13, 2024
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

2 participants