xiancode / vim

Automatically exported from code.google.com/p/vim
0 stars 0 forks source link

cindent: regression in C++ class indenting after 7.3.202 #9

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Try indenting a file with the following contents with the settings as specified 
by the modeline:

#v+
// vim: cindent cino=(0,gs,hs et sw=8
class Foo : public Bar
{
        public:
                virtual void method1(void) = 0; // FIXME: 2 indent levels
                virtual void method2(int arg1,
                                     int arg2,
                                     int arg3) = 0;
};
#v-

What is the expected output? What do you see instead?

The output file should be identical as the input but instead method 
declarations are indented one level too few:

#v+
// vim: cindent cino=(0,gs,hs et sw=8
class Foo : public Bar
{
        public:
        virtual void method1(void) = 0; // FIXME: 2 indent levels
        virtual void method2(int arg1,
                             int arg2,
                             int arg3) = 0;
};

#v-

As noted in the summary, the problem was introduced in 7.3.202.

Original issue reported on code.google.com by lech.lor...@gmail.com on 12 Jun 2011 at 11:20

GoogleCodeExporter commented 9 years ago
Since this bug is pretty annoying, I had a look at the code introduced by patch 
7.3.202 and wrote a quick fix for the indentation issue (see attached patch). 
It seems to work properly but someone else should have a look and verify that 
it's sane.

Original comment by martin.g...@gmail.com on 15 Sep 2011 at 6:06

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by lech.lor...@gmail.com on 27 Nov 2011 at 10:14

GoogleCodeExporter commented 9 years ago

Original comment by lech.lor...@gmail.com on 27 Nov 2011 at 10:14