FR: Option to not highlight short hex codes like `#123`
chrisgrieser opened this issue · 4 comments
Request for additional color space
No response
Request for other features
There are various strings like #123
for referencing GitHub issues, which also get highlighted by ccc. An option to disable highlighting short hex codes would be useful for this, but looking through the readme, there is no such option.
Related issue #76 was closed without resolution (and there does not seem to be a follow-up in the discussion), the option exclude_pattern
mentioned in linked issues was apparently removed in 698ba07, thus there does not seem to be any option or method to achieve this on the user's end.
If this is a common request, and we are talking about 77 solutions being too cumbersome, perhaps we should add an option for easier setup.
Let me know your opinion.
Like this
local ccc = require'ccc'
ccc.setup {
pickers = {
ccc.picker.hex.new({
mode = "long" -- or "short" or "all"
})
}
}
#77 couldn't help you?
Ah, I missed that one, because the discussion was closed and is thus not initially shown when going to the Discussions
tab. (kinda annoying design choice by GitHub…) Yeah, the suggestion there works, I added this to before the setup call:
ccc.picker.hex.pattern = { [=[\v%(^|[^[:keyword:]])\zs#(\x\x)(\x\x)(\x\x)>]=] }
If this is a common request, and we are talking about 77 solutions being too cumbersome, perhaps we should add an option for easier setup.
Well, since it's only a one-liner, it's not too cumbersome. Nonetheless, I think a that having strings like #123
referring to github references is very common, so that it is worth it to make a simple option out of it. Even though it may be a picker in ccc's internal logic, from a user perspective, I'd find it more intuitive if it is a sub-key of highlighter
, for example:
local ccc = require'ccc'
ccc.setup {
highlighter = {
highlight_short_hex_keys = true;
}
}
Well, since it's only a one-liner, it's not too cumbersome. Nonetheless, I think a that having strings like #123 referring to github references is very common, so that it is worth it to make a simple option out of it. Even though it may be a picker in ccc's internal logic, from a user perspective, I'd find it more intuitive if it is a sub-key of highlighter, for example:
local ccc = require'ccc' ccc.setup { highlighter = { highlight_short_hex_keys = true; } }
I would like the design to be closed to only editing the picker, the way to control the colors that can be highlighted/picked. So I'm not sure I can accept that suggestion.