From 33d4bb4a644c05d369d02809f0b545d956e51da1 Mon Sep 17 00:00:00 2001 From: akianonymus Date: Sun, 26 Feb 2023 23:47:38 +0530 Subject: fix: Make always update buffer configurable | #52 disabled by default --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index 9944770..bec9fc3 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,9 @@ library to do custom highlighting themselves. -- parsers can contain values used in |user_default_options| sass = { enable = false, parsers = { "css" }, }, -- Enable sass colors virtualtext = "■", + -- update color values even if buffer is not focused + -- example use: cmp_menu, cmp_docs + always_update = false }, -- all the sub-options of filetypes apply to buftypes buftypes = {}, @@ -160,6 +163,13 @@ require 'colorizer'.setup { }, } +-- Alwyas update the color values in cmp_docs even if it not focused +require 'colorizer'.setup { + filetypes = { + '*'; -- Highlight all files, but customize some others. + cmp_docs = {always_update = true} + }, +} ``` In `user_default_options`, there are 2 types of options @@ -188,6 +198,22 @@ e.g: Here `names`, `RGB`, `RRGGBB`, `RRGGBBAA` is enabled but not `rgb_fn` and ` require 'colorizer'.setup { user_default_options = { css_fn = false, css = true } } ``` +### Updating color even when buffer is not focused + +Like in floating windows, popup menu, etc + +use `always_update` flag. Use with caution, as this will update for any change in that buffer, whether focused or not. + +```lua +-- Alwyas update the color values in cmp_docs even if it not focused +require 'colorizer'.setup { + filetypes = { + '*'; -- Highlight all files, but customize some others. + cmp_docs = {always_update = true} + }, +} +``` + All the above examples can also be apply to buftypes. Also no buftypes trigger colorizer by default Buftype value is fetched by `vim.bo.buftype` -- cgit v1.2.3-70-g09d2