Question

Emacs doesn't properly indent C++ class definitions for allocators that have initializers with colons in them. I think that this is because lines with colons are left-indented in many cases.

I would like to fix this.

Here is an example of what I am talking about.

EMACS indents the code like this:

class demo {
    int x;
    demo(){
    }
 demo(int y):x(y){
    };
};

But it should really indent it like this:

class demo {
    int x;
    demo(){
    }
    demo(int y):x(y){
    };
};

Is there a way to fix this behavior? Presumably we need some elisp...

Thanks!

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top