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: When I sert names_custom, colorcode in "" doesn't show their color #141

Open
Jaehaks opened this issue Jan 29, 2025 · 5 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@Jaehaks
Copy link

Jaehaks commented Jan 29, 2025

Describe the bug
If I disable names_custom, it shows coloriezed RGB in "" like this

Image

but when I enabled, colorcode in "" doesn't show their color. without "", it works

Image

What I missed?

To Reproduce
configuraiton is

enabled = true,
"catgoose/nvim-colorizer.lua",
event = "BufReadPre",
opts = { -- set to setup table
  lazy_load = true,
  user_default_options = {
    names = true,
    RGB = true,
    RRGGBB = true,
    names_custom = {
      ["'r'"]   = "#FF0000",
      ["\"r\""] = "#FF0000",
      ["'g'"]   = "#00FF00",
      ["\"g\""] = "#00FF00",
      ["'b'"]   = "#0000FF",
      ["\"b\""] = "#0000FF",
      ["'c'"]   = "#00FFFF",
      ["\"c\""] = "#00FFFF",
      ["'m'"]   = "#FF00FF",
      ["\"m\""] = "#FF00FF",
      ["'y'"]   = "#FFFF00",
      ["\"y\""] = "#FFFF00",
      ["'k'"]   = "#000000",
      ["\"k\""] = "#000000",
      ["'w'"]   = "#FFFFFF",
      ["\"w\""] = "#FFFFFF",
    }
  }
},

Expected behavior
It show their color even though the code is in "" or isn't in ""

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

Operating System:
Windows 10

Neovim Version:
v0..10.2

@Jaehaks Jaehaks added the bug Something isn't working label Jan 29, 2025
@catgoose
Copy link
Owner

The first screenshot is just the RRGGBB highlighting.

The single quoted names seem to show up fine:

Image

I think the names parser does not handle " well. If I exclude " from the additional non-alphanumeric valid characters (space is also excluded because someone needed spaces in a color name 👯 ) then the single quote colors are highlighted:

Image

But then if I exclude ' from additional non-alphanumerics:

Image

@catgoose
Copy link
Owner

catgoose commented Jan 29, 2025

Can you try with fix/141-quotes_and_doublequotes branch?

Try without escaping the ". Surround the double quotes with single quotes.

Image

@Jaehaks
Copy link
Author

Jaehaks commented Jan 29, 2025

The branch fix/141-quotes_and_doublequotes works well.
Thanks!

@catgoose
Copy link
Owner

Ok please use it until I close this issue and let me know if you have any problems.

@Jaehaks
Copy link
Author

Jaehaks commented Jan 29, 2025

Ok I will

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