Menu

#569 option "--break-blocks" doesn't work for classes and functions

closed-fixed
None
2024-05-09
2024-04-27
Roy Qu
No

The explanation for option "--break-blocks" in astyle -h is

--break-blocks  OR  -f
Insert empty lines around unrelated blocks, labels, classes, ...

But when I tried to format the following code:

class A {
    int xxx;
};
class B {
    int yyy;
};
int test() {
    return 0;
}
int test2() {
    return 1;
}

by running astyle --break-blocks < untitled1.cpp, I got:

class A {
    int xxx;
};
class B {
    int yyy;
};
int test() {
    return 0;
}
int test2() {
    return 1;
}

No empty lines was added. It seems that the option doesn't work for class and function blocks.
And the option "--break-blocks " doesn't work, too.

Discussion

  • Roy Qu

    Roy Qu - 2024-04-27

    Fix: the option "--break-blocks=all" doesn't work, too.

     
  • André Simon

    André Simon - 2024-05-09
    • status: open --> closed-fixed
    • assigned_to: André Simon
     
  • André Simon

    André Simon - 2024-05-09

    Fixed in 3.4.15

     

Log in to post a comment.