Author Topic: structural highlighting  (Read 12442 times)

Offline DFO

  • Single posting newcomer
  • *
  • Posts: 2
structural highlighting
« 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:

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.
« Last Edit: July 23, 2014, 05:36:29 am by DFO »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: structural highlighting
« Reply #1 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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline DFO

  • Single posting newcomer
  • *
  • Posts: 2
Re: structural highlighting
« Reply #2 on: August 05, 2014, 12:13:18 pm »
Yes, that and orange brackets enclosing "else" blocks.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: structural highlighting
« Reply #3 on: August 05, 2014, 08:37:12 pm »
The orange lines are called indent guides and I think they are available...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

extremefishandchip

  • Guest
Re: structural highlighting
« Reply #4 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.

Offline yvesdm3000

  • Almost regular
  • **
  • Posts: 225
Re: structural highlighting
« Reply #5 on: December 16, 2016, 07:28:36 am »
Isn't that STYLE_INDENTGUIDE ?

Yves
Clang based code completion for Code::Blocks:   http://github.com/yvesdm3000/ClangLib

Offline yvesdm3000

  • Almost regular
  • **
  • Posts: 225
Re: structural highlighting
« Reply #6 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
Clang based code completion for Code::Blocks:   http://github.com/yvesdm3000/ClangLib

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: structural highlighting
« Reply #7 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
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline yvesdm3000

  • Almost regular
  • **
  • Posts: 225
Re: structural highlighting
« Reply #8 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
Clang based code completion for Code::Blocks:   http://github.com/yvesdm3000/ClangLib

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: structural highlighting
« Reply #9 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.
« Last Edit: December 16, 2016, 09:41:56 pm by oBFusCATed »
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]