Code::Blocks

Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: DFO on July 23, 2014, 03:36:32 am

Title: structural highlighting
Post by: DFO on July 23, 2014, 03:36:32 am
I enjoy using Code::Blocks but what it lacks is a full-scale structural highlight plugin, as on the picture below:
(http://i.stack.imgur.com/CYfh1.gif)
I wonder if there's any solution or any development in this field?

I believe it would be beneficial for the project, because so many popular IDE (Visual Studio, Intellij Idea etc) have this feature either with help of plug-ins or even out of the box. Naturally, having such a feature in Code::Blocks would draw more attention to the project from those who are used to such a highlighting.
Title: Re: structural highlighting
Post by: oBFusCATed on July 28, 2014, 10:17:34 am
We're using Scintilla for our code-editor component and I don't think Scintilla supports this at the moment.

BTW: Are you talking about the purple brackets around if/esle clauses. Keep in mind that we've might not seen this feature in action, so we need clearer explanation how it works.
Title: Re: structural highlighting
Post by: DFO on August 05, 2014, 12:13:18 pm
Yes, that and orange brackets enclosing "else" blocks.
Title: Re: structural highlighting
Post by: oBFusCATed on August 05, 2014, 08:37:12 pm
The orange lines are called indent guides and I think they are available...
Title: Re: structural highlighting
Post by: extremefishandchip on December 16, 2016, 07:01:19 am
Hi oBFusCATed, you said it's available but you clarify more how to enable it? I have check the editor for indent guides and did not see an option for it. Thanks.
Title: Re: structural highlighting
Post by: yvesdm3000 on December 16, 2016, 07:28:36 am
Isn't that STYLE_INDENTGUIDE ?

Yves
Title: Re: structural highlighting
Post by: yvesdm3000 on December 16, 2016, 08:44:30 am
See attachment on how these indent guides look like. I hacked this temporarily in a plugin to see how it would look like: I only added 2 lines of code: set the color and activate

I searched the codeblocks source code but could not find code that activates this feature.

It's not so hard to add I think.

Yves
Title: Re: structural highlighting
Post by: oBFusCATed on December 16, 2016, 09:14:13 am
Hi oBFusCATed, you said it's available but you clarify more how to enable it? I have check the editor for indent guides and did not see an option for it. Thanks.

Settings ->Editor -> General settings -> Editor settings -> Show indentation guides
Title: Re: structural highlighting
Post by: yvesdm3000 on December 16, 2016, 09:36:26 am
Hi oBFusCATed, you said it's available but you clarify more how to enable it? I have check the editor for indent guides and did not see an option for it. Thanks.

Settings ->Editor -> General settings -> Editor settings -> Show indentation guides

Can we also configure its colour trough the GUI ?

Yves
Title: Re: structural highlighting
Post by: oBFusCATed on December 16, 2016, 09:39:32 pm
Don't know. If it is possible in scintilla then it can be made configurable in the UI.

Edit:
Quote
SCI_SETINDENTATIONGUIDES(int indentView)
SCI_GETINDENTATIONGUIDES → int
Indentation guides are dotted vertical lines that appear within indentation white space every indent size columns. They make it easy to see which constructs line up especially when they extend over multiple pages. Style STYLE_INDENTGUIDE (37) is used to specify the foreground and background colour of the indentation guides.

Patches welcome. Make sure to use the cbColourManager.