Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

About AStyle plugin, Here is a new problem

(1/3) > >>

Loaden:
AStyle version: 1.23
and the arguments is:

--- Code: -----style=allman --indent=spaces --indent-cases --indent-preprocessor --pad-oper --unpad-paren --keep-one-line-statements --keep-one-line-blocks --convert-tabs --suffix=none
--- End code ---
If use this arguments, it's can be format this code FROM:

--- Code: ---int main()
{
    for(int i=0;i<10;++i)
    {
        cout << i << endl;
    }
    return 0;
}

--- End code ---
TO:

--- Code: ---int main()
{
for (int i = 0; i < 10; ++i)
{
cout << i << endl;
}
return 0;
}
--- End code ---

NOTICE:
for{HERE is a space}(int i = 0; i < 10; ++i)

But, if i setting AStyle Plugin like below picture show, it's only format the code TO:

--- Code: ---int main()
{
for(int i = 0; i < 10; ++i)
{
cout << i << endl;
}
return 0;
}
--- End code ---

IN for and (, NOT space in there.

[attachment deleted by admin]

Loaden:
I'am sorry! It's seems works now. SVN6080
if i selected the option on cursor position.

[attachment deleted by admin]

Loaden:
Still have problems, if this option is enabled, the following code to have a problem.

--- Code: ---#include <windows.h>

int main()
{
    for (int i = 0; i < 10; ++i)
    {
        cout << i << endl;
    }

    ::MessageBox (0, 0, 0, 0);
    return 0;
}

--- End code ---

--- Code: ---::MessageBox(0, 0, 0, 0);
--- End code ---
formated to
--- Code: ---::MessageBox (0, 0, 0, 0);
--- End code ---

MortenMacFly:

--- Quote from: Loaden on January 24, 2010, 04:41:59 pm ---
--- Code: ---::MessageBox(0, 0, 0, 0);
--- End code ---
formated to
--- Code: ---::MessageBox (0, 0, 0, 0);
--- End code ---


--- End quote ---
Well if you have enabled the option "Insert space padding around parenthesis on the outside" as shown in the screenshot of the previous post that's exactly what has to happen...?!

Loaden:

--- Quote from: MortenMacFly on January 24, 2010, 04:45:59 pm ---
--- Quote from: Loaden on January 24, 2010, 04:41:59 pm ---
--- Code: ---::MessageBox(0, 0, 0, 0);
--- End code ---
formated to
--- Code: ---::MessageBox (0, 0, 0, 0);
--- End code ---


--- End quote ---
Well if you have enabled the option "Insert space padding around parenthesis on the outside" as shown in the screenshot of the previous post that's exactly what has to happen...?!

--- End quote ---
It's seems lost this option.

http://astyle.sourceforge.net/astyle.html#_unpad-paren

--unpad-paren / -U / --unpad=paren (depreciated)
Remove extra space padding around parenthesis on the inside and outside.  Any end of line comments will remain in the original column, if possible. This option can be used in combination with the paren padding options pad‑paren‑out and pad‑paren‑in above. Only padding that has not been requested by other options will be removed.

For example, if a source has parens padded on both the inside and outside, and you want inside only. You need to use unpad-paren to remove the outside padding, and pad‑paren‑in to retain the inside padding. Using only pad‑paren‑in would not remove the outside padding.

if ( isFoo( a, b ) )
    bar ( a, b );
becomes (with no padding option requested):

if (isFoo(a, b))
    bar(a, b);

Navigation

[0] Message Index

[#] Next page

Go to full version