Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: Kahenraz on February 19, 2019, 10:27:48 am
-
When I select a block of text and perform an indentation with tab, I want the whitespace to indent along with it. The reason for this is that I want my cursor to remain within the same horizontal block as I cursor down through the code. It bothers me that it truncates all the way to the left.
I can't seem to find a way to do this in Code::Blocks. Is there a setting for something like this?
Thank you.
-
Can you try to give a better explanation? I'm not sure what the problem is...
You want the cursor to move with the indentation?
-
I think the problem is in line 11 (empty line), it doesn't indent when you select with multiple lines and press tab.
-
I think the problem is in line 11 (empty line), it doesn't indent when you select with multiple lines and press tab.
This is correct. I want the whitespace of my selection to be indented along with the rest of the code.
-
Does not every IDE these days by default remove trailing whitespace? And isnt this a good thing for git and the like?
-
Not if it directly contradicts a coding style. Every time I indent something, I have to manually cursor around and indent the whitespace.
I don't have this problem on Eclipse as it will both indent whitespace in selections as well as with the code style formatter. The same goes for any of my other editors.
This is my first time using Code::Blocks and I was very surprised as this behavior.
As far as Git is concerned, it is a non-issue either way as it has options natively to ignore whitespace changes.
-
Did you make sure that "Strip Trailing Blanks" is unchecked.
It then works for me once I have the spaces indented once; does not change zero spaces on a line.
Edit2: It looks like you already noticed this.
Settings -> Editor
Tab: Editor Setting
Section: End of Line options
Tim S.
-
The problem seems to be that the IDE will not indent lines which are empty.
Can an option be added to allow this? Is this behavior that can be modified by a plugin?
Thank you.
-
I doubt a plugin can do this. I tested scite and geany and both editors behave the same as codeblocks, so I think the change should be introduced in scintilla's Indent function (Editor::Indent).