NvChad / nvim-colorizer.lua

Maintained fork of the fastest Neovim colorizer
Other
708 stars 47 forks source link

Bug: colors improperly highlighted in cmp menu #54

Closed Subjective closed 1 year ago

Subjective commented 1 year ago

Describe the bug Colors are randomly highlighted in cmp menu when used with tailwindcss-colorizer-cmp.nvim.

To Reproduce

  {
    "hrsh7th/nvim-cmp",
    dependencies = {
      { "roobert/tailwindcss-colorizer-cmp.nvim", config = true },
    },
    opts = function(_, opts)
      local format_kinds = opts.formatting.format
      opts.formatting.format = function(entry, item)
        format_kinds(entry, item)
        return require("tailwindcss-colorizer-cmp").formatter(entry, item)
      end
    end,
  },
  {
    "NvChad/nvim-colorizer.lua",
    opts = {
      user_default_options = {
        tailwind = true,
      },
    },
  },

Expected behavior I would expect the tailwind colors to not be highlighted in the completion menu.

Screenshots Screen Recording 2023-03-26 at 5 20 36 PM

Operating System: MacOS 13.2

Neovim Version: 0.9.0 nightly

Colorizer Version: dde3084106a70b9a79d48f426f6d6fec6fd203f7

Additional context Add any other context about the problem here.

Subjective commented 1 year ago

Never mind, I was able to fix this by setting

filetypes = {
  "!cmp_menu",
},
Akianonymus commented 1 year ago

If you want to make it always work in cmp menu or cmp docs, you can use this.

This is for cmp_docs

filetypes = {
    '*'; -- Highlight all files, but customize some others.
    cmp_docs = {always_update = true}
  },
catgoose commented 5 months ago

If you want to make it always work in cmp menu or cmp docs, you can use this.

This is for cmp_docs

filetypes = {
    '*'; -- Highlight all files, but customize some others.
    cmp_docs = {always_update = true}
  },

If you want it to colorize the cmp menu as well you have to do:

        cmp_docs = {
            always_update = true,
        },
        cmp_menu = {
            always_update = true,
        },