norcalli / nvim-colorizer.lua

The fastest Neovim colorizer.
Other
2.25k stars 117 forks source link

Bug: Colorizer stop working when switching out and back #41

Open 20jam opened 4 years ago

20jam commented 4 years ago

Describe the bug Colorizer / highlighting color code, stop working when I switch out of the nvim window and go back

Configuration.

require 'colorizer'.setup {
  css = { rgb_fn = true; };
  scss = { rgb_fn = true; };
  sass = { rgb_fn = true; };
  stylus = { rgb_fn = true; };
  vim = { names = true; };
  tmux = { names = false; };
  'javascript';
  'javascriptreact';
  'typescript';
  'cpp';
  'typescriptreact';
  html = {
    mode = 'foreground';
  }
}

Expected behavior A clear and concise description of what you expected to happen. Color highlighting is on regadless Screenshots If applicable, add screenshots to help explain your problem.

Operating System: e.g. Ubuntu 16.04

Neovim Version: e.g. 0.4.2

Colorizer Version: Current

cxgslegend commented 4 years ago

I am having pretty much the same issue. I have an auto command that resources my init.vim file on save. So when I save the file, all the colors go away, and they won't come back if I call any of the colorizer commands. I tried putting them in a separate lua file, and then bringing them in with luafile, but that did the same thing.

lua << EOF
require 'colorizer'.setup(
    {'*';},
    {
        RGB      = true;        -- #RGB hex codes
        RRGGBB   = true;        -- #RRGGBB hex codes
        names    = true;        -- "Name" codes like Blue
        RRGGBBAA = true;        -- #RRGGBBAA 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 modes: foreground, background
        mode     = 'background'; -- Set the display mode.
    })
EOF
alexaandru commented 4 years ago

I have the exact same issue as @cxgslegend (colors for init.vim go away after it is resourced).

mangelozzi commented 4 years ago

Also got this problem. Its great when it works, I mostly use it for themes, which means the moment I test the theme colorizing stops, and one can't use the tool to tweak the colors.