Closed Jaehaks closed 7 months ago
Hello, What do you mean by "set'? Could you provide more information?
BTW, as far as i can see, It's working as expected. I recommend experimenting with string.gmatch
function in lua as this is what I use to run the lua patterns
@brenoprata10 That may be a siliiy question, Could you give me some example what you tested? the set means that character sets in lua regex pattern as Programming in Lua : 20.2
A char-set allows you to create your own character classes, combining different classes and single characters between square brackets. For instance, the char-set '[%w_]' matches both alphanumeric characters and underscores, the char-set '[01]' matches binary digits, and the char-set '[%[%]]' matches square brackets. To count the number of vowels in a text, you can write
I tested with string.gmatch
, its pattern worked, but the pattern does not in only nvim-highlight-colors
I tested the pattern in test.lua file like this
s = "hello world from Lua red 'red' \"red\" UredP"
for w in string.gmatch(s, "[\'\"]red[\"\']") do
print(w)
end
and the result is successful what I intend to
If I configure like below code the 'red' and "red" does not be highlighted
but do you mean that these pattern works successful?
The custom_colors property is not meant to receive a lua pattern. The mention of gsub is mostly to escape the possible characters that might create a conflict when running the pattern on the plugin side. You should stick with any of the these you already tried: label = 'red' => works for all red label = '%'red%'' => works for all 'red' label = '%'red%'' => works for all 'red'
@brenoprata10 I understand, Thank you~!
If I set the pattern with [set], it does not work
1) label = 'red' => works for all red 2) label = '%'red%'' => works for all 'red' 3) label = '%'red%'' => works for all 'red' 3) label = "[']red[']" => not work
is it normal?