Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: Elena on October 20, 2025, 02:02:00 pm

Title: Moving a block by tabs
Post by: Elena on October 20, 2025, 02:02:00 pm
I apologize in advance if this seems an obvious or noob question, but is there any way to move a selected block of code back or forth by one or more tabs ?
Suppose I pasted a function block which was aligned to column zero into a class, where everything is shifted to the right by one tab. The only (annoying) solution I can see is adding manually a tab at beginning of every line, but I can't believe an easier method is not provided... Thx
Title: Re: Moving a block by tabs
Post by: blauzahn on October 20, 2025, 07:12:21 pm
At least on Linux it works and has always worked ootb: select than indent or unindent by tab or shift-tab. For Windows: no idea.

Reasons within cb might be: You have changed some editor setting (tab or/and indent option) or a codeformatter nullifies that immediately.
Glancing at a few of your older posts suggests the former.

Title: Re: Moving a block by tabs
Post by: Elena on October 20, 2025, 07:26:28 pm
Thanks, this works !
No, I didn't say that indenting/unindenting a selected block does not work, and I haven't changed the relevant settings. Just I didn't think it was so simple lol 😉
Title: Re: Moving a block by tabs
Post by: blauzahn on October 20, 2025, 08:41:28 pm
Thanks for the quick feedback.