Other [new feature] Auto Format

Erel

B4X founder
Staff member
Licensed User
Longtime User
The next version of B4A will include an auto-formatting feature.

test.gif


It fixes the code indentation. You can activate it by selecting the text and pressing on Alt + F. It will also be applied to pasted code. This is very useful as code copied from the forum doesn't include any tabs at all.
 
D

Deleted member 103

Guest
You can activate it by selecting the text and pressing on Alt + F. It will also be applied to pasted code.
I like it!
Better would be if it would happen automatically (see Visual Studio), so without Alt + F.
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
With the current IDE 6.30, when you press the Alt + F, the 'File' Selection menu pops up. What happens when the new feature for the auto format is implemented?
 
Upvote 0

MitchBu

Well-Known Member
Licensed User
Longtime User
Excellent idea. But I wonder if Alt-F, which is a windows shortcut for the Files menu, is the most appropriate.

What about Ctrl-Alt-F instead, which does not conflict. Or add this option as well to the right click menu, like block comment ?
 
Upvote 0

Pendrush

Well-Known Member
Licensed User
Longtime User
@DonManfred
This feature is in gray zone, exist and not exist, while is in a gray zone, I have made a question in proper post, as I don't know is maybe already work as I ask, because I cannot test it. Thank you.
 
Upvote 0

MitchBu

Well-Known Member
Licensed User
Longtime User
Nice... A matter of taste here: Will the "leading space(s)" be removed? (

The whole point of indent is to have spaces before the nested if. Besides, as far as I understand, since it is an option, you use or not depending on your taste, unlike some other products I use where it is automatically enforced.

At present I have to format myself, and yes, I have been accustomed to indent code, for legibility. I will enjoy having automation here.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0
Top