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

Bug: Colorizer stop working when switching out and back

Open 20jam opened this issue 5 years ago • 3 comments

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

20jam avatar May 24 '20 01:05 20jam

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

cxgslegend avatar Jun 29 '20 16:06 cxgslegend

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

alexaandru avatar Jul 30 '20 13:07 alexaandru

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.

mangelozzi avatar Aug 11 '20 09:08 mangelozzi