-
Having searched through similar issues, most closely related of which is #14. I couldn't/cannot get this plugin to stop highlighting any numbers preceded by a # e.g. I tried using the hex = {
'%s#%x%x%x%s+',
'[%w_]#%x%x%x',
'[%w_]#%x%x%x%x%x%x',
}, but the following text in a I'm pretty sure that lua pattern works as I've tested that it would match the pattern but it doesn't stop the highlighting. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
local ccc = require("ccc")
local HexPicker = ccc.picker.hex
HexPicker.pattern = {
[=[\v%(^|[^[:keyword:]])\zs#(\x\x)(\x\x)(\x\x)>]=],
[=[\v%(^|[^[:keyword:]])\zs#(\x)(\x)(\x)>]=],
}
ccc.setup({
-- Other options
-- ...
pickers = {
HexPicker,
ccc.picker.css_rgb,
ccc.picker.css_hsl,
ccc.picker.css_hwb,
ccc.picker.css_lab,
ccc.picker.css_lch,
ccc.picker.css_oklab,
ccc.picker.css_oklch,
},
}) |
Beta Was this translation helpful? Give feedback.
-
Implementation is here. |
Beta Was this translation helpful? Give feedback.
-
New solution. |
Beta Was this translation helpful? Give feedback.
exclude_pattern
option is now obsolete. It was intended to specify word boundaries, and I have decided that regular expressions\<
,\>
and[[:keyword:]]
are sufficient for this purpose.Everything passed to pickers in
ccc.setup()
is an object, and manipulating this entity will accomplish the goal. Specifically, HexPicker has a field called pattern, which can be rewritten.