Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Indentation guides in Qt Creator?

Is it possible to tell the editor in Qt Creator (I'm using V.4.9.2) to show some "indentation guides" like in C++Builder (default), Notepad++ (default) or Visual Studio (via plugin)?

What I mean are lines like the colored vertical ones in the next picture (which is a screenshot from C++Builder).

C++Builder code snippet

  • Have I overlooked something?
  • Is there a plugin available?

Please note: I'm aware of the editor option "Highlight blocks" which goes into the right direction but is more distracting than helpful in my opinion.

like image 347
FlKo Avatar asked Oct 03 '17 20:10

FlKo


People also ask

How to indent in Qt Creator?

To automatically indent the highlighted text, select Auto-indent Selection or press Ctrl+I. To automatically format the highlighted text, select Auto-format Selection or press Ctrl+;. To adjust the wrapping of the selected paragraph, select Rewrap Paragraph or press Ctrl+E followed by R.


1 Answers

It seems there is no exact match.

But you have two options that may serve to give you the necessary guides.

From tools - options - text editor - display

  • visualize whitespace

enter image description here

Which is actually quite annoying because it also visualizes spacebars, unless you are one of those insane maniacs who don't use the spacebar. Not using the spacebar finally makes sense if you use that feature.

  • there is also "highlight blocks"

enter image description here

Which is a tad better, but it only highlights the hierarchy of blocks you are currently in. Plus it grays out everything else, which is annoying too.

So you have the option to pick between those two annoyances.

Even better, you can even have both at the same time.

You might also consider issuing a feature request at the bug tracker. It seems simple enough to actually get implemented before you reach retirement age.

like image 158
dtech Avatar answered Oct 05 '22 16:10

dtech