aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorakianonymus <anonymus.aki@gmail.com>2023-02-26 23:47:38 +0530
committerakianonymus <anonymus.aki@gmail.com>2023-02-26 23:49:16 +0530
commit33d4bb4a644c05d369d02809f0b545d956e51da1 (patch)
tree8961abb5e08c45d575b435e7f5407c6b463fe5e5 /README.md
parentfeat: Support modern rgb/rgba syntax (diff)
fix: Make always update buffer configurable | #52
disabled by default
Diffstat (limited to 'README.md')
-rw-r--r--README.md26
1 files changed, 26 insertions, 0 deletions
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`