From: Patrick H. <pat...@mi...> - 2003-07-25 08:08:37
|
When I use the an access modifier (e.g. public, private, etc.) in a class (to make inlined constructors or functions), the indentation gets completely wrong. This doesn't happen with variables or typedefs or extern functions, only inlined functions. This bug is workable, but means that I have to copy tabs from somewhere else to the first line of the function and to the end brace or else have to temporarily make a useless variable after the access modifier to fix it, since it only happens the next statement. It isn't too anoying, though, as it only happens once or twice a class, although I tend to use templates a lot and they force me to inline functions to allow some compilers (VC++ 6) to compile. This only happens on access specifiers in C++, not Java and so I think it is related to the colon. Thanks for your help. Patrick And now for an example (copied from emacs and then replaced all the tabs with 4 spaces for the e-mail): char*s="EMACS 21.3 in cc-mode 5.30.3 on windows 2k wrote: (It also happens in linux on cc-mode 5.30)"; class MyClass { int myVariable; public: MyClass() { myVariable = 1; } MyClass(int myNewVariable) { myVariable = myNewVariable; } } s="When it should have written: (I know that this bug did not occur in cc-mode 5.28)"; class My2Class { int myVariable; public: int uselessvar; // To make emacs indent correctly My2Class() { myVariable = 1; } My2Class(int myNewVariable) { myVariable = myNewVariable; } } |