Re: Colorizing braces using indicators

"[email protected]" <[email protected]>
Newsgroups gmane.comp.lib.scintilla.devel
Message-ID <[email protected]>
Well it was my first thought too when I was first having problems. I also 
tried resetting the indicator with:

styler.IndicatorFill(i, i+1, indicator, indicator);
styler.IndicatorFill(i+1, i+1, 0, 0);

but that didn't help.
On Tuesday, March 26, 2024 at 2:40:00 PM UTC-5 [email protected] 
wrote:

> Which is why it was a stupid question :)
>
> On Tuesday, March 26, 2024 at 6:56:48 PM UTC [email protected] wrote:
>
>> I did. It has no effect if start and end are the same.
>>
>> On Tuesday, March 26, 2024 at 10:40:38 AM UTC-5 
>> [email protected] wrote:
>>
>>> Stupid question
>>>
>>> styler.IndicatorFill(i, i+1, indicator, indicator);
>>>
>>> Did you try using i, i? I haven't looked at the doc, but I ass-u-me it 
>>> is start-pos, stop-pos for the first two parameters so you need it to be 
>>> the same value for both to highlight exactly one character, yes?
>>>
>>> On Tuesday, March 26, 2024 at 3:18:47 PM UTC [email protected] wrote:
>>>
>>>> I'm trying to colorize braces { and } using the fold level (like VS 
>>>> Code). In my lexer's folder function, I'm using the brace's line's fold 
>>>> level to determine which indicator to use (I rotate 3 different indicators 
>>>> using (level % 3)). The braces are colorized correctly when I open a 
>>>> file but when I type the braces, the characters that follow pick up the 
>>>> color of the preceding brace. I've tried resetting the current indicator to 
>>>> 0 to no effect. What am I missing?
>>>>
>>>>         if (ch == '{') {        
>>>>                 indicator = (levelNext % 3) + 1;
>>>>                 styler.IndicatorFill(i, i+1, indicator, indicator);
>>>>                 levelNext++;
>>>>         }
>>>>         else if (ch == '}') {
>>>>                 levelNext--;
>>>>                 indicator = (levelNext % 3) + 1;
>>>>                 styler.IndicatorFill(i, i+1, indicator, indicator);
>>>>         } 
>>>>  
>>>> In the screenshot, lines 1-9 already existed and lines 11-19 were typed 
>>>> in.
>>>> [image: Screenshot 2024-03-26 at 9.58.52 AM.png]
>>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/scintilla-interest/d223e493-e8b8-45e8-8f84-e85fa4676bfen%40googlegroups.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.