On Thu, 15 Dec 2022 at 02:42, Asif Aaron Amin via Devel <devel@lists.geany.org> wrote:
All, 

First I'd like to thank you for developing Geany as it has been my preferred IDE for 7 years due to how customizable and fast it is, especially over ssh/X forwarding. I also use VS Code in certain instances, and one of the features that I really wish was in Geany is the bracket pair colorization. Has anyone proposed this or is currently working on such functionality? 

I presume you mean VS code using differing colours for each nesting level of braces.  I also happen to use VS, but you can't expect that contributors to one project will be aware of the features of others apps, you need to describe the feature you want.
 

I decided to take a crack at implementing this into geany via a plugin based on this blog post: https://code.visualstudio.com/blogs/2021/09/29/bracket-pair-colorization

I got a simple a proof of concept working, basically using SCI_BRACEMATCH with indicators that colored braces with SCI_INDICSETSTYLE/INDIC_TEXTFORE/SCI_INDICSETFORE

image.png

Is this approach reasonable? I'm not sure how well this will scale on large documents or if using indicators for this purpose is valid

Without seeing your code, can't tell, you point to the VScode plugin, but not yours ;-)

Probably best if you just try it on big files ... using a slow computer, eg Raspberry PI.  To reduce its impact only run it after a delay after change, and reset the delay if another change happens in the meantime.  That way it runs when the user stops or slows typing.

Using a plugin seems a sensible idea, the alternative of having the Lexers do it means changing every lexer, but your plugin should be able to work for any language.

Cheers
Lex


Thanks! 

_______________________________________________
Devel mailing list -- devel@lists.geany.org
To unsubscribe send an email to devel-leave@lists.geany.org