nvim-colorizer.lua icon indicating copy to clipboard operation
nvim-colorizer.lua copied to clipboard

Bug: Applying css features via filetype table doesn't override defaults

Open daephx opened this issue 2 years ago • 0 comments

Application Versions:

OS: WSL2 Ubuntu 22.04 Neovim: NVIM v0.10.0-dev

Colorizer Version::

Note: This didn't work with my setup. find ~/.config/nvim/ -type d -name 'nvim-colorizer.lua' -exec git rev-parse HEAD \;

The provided command outputted: b1f99fc618c2f4f262dde607785c3eac9fc61933 This is the actual installed version: dde3084106a70b9a79d48f426f6d6fec6fd203f7

Describe the bug

This might be tangentially related to #48.

For my config I don't like names or RGB to be globally enabled, but for css filetypes these can be helpful. So I figured the css = true option would be a concise way to allow those features to be limited to only css filetypes.

This does not work, requiring the user to explicitly override the disabled options defined in user_default_options.

setup = {
  user_default_options = {
    RGB = false, -- annoying in some contexts
    names = false, -- annoying in some contexts
    mode = "background",
  },
  filetypes = {
    "*", -- Use default options for all other filetypes

    -- This should be sufficient to ensure all css features are enabled
    -- css = { css = true },

    -- Unfortunately, these settings need to be explicitly enabled to override user_default_options
    css = { css = true, names = true, RGB = true },
  },
}

daephx avatar Apr 18 '23 07:04 daephx