DrewBoo: Please have in mind that the Source Code Formatter plugin uses AStyle to do its magic. If the changes you're proposing modify the AStyle code, then you should send them to the AStyle project. If, on the other hand, the changes you're proposing modify the plugin, the do as dmoore suggested: submit a patch to BerliOS and then report here that you did so.
I'll take this opportunity to ask for feature request,(mods feel free to delete if it doesn't belong)
Request:
When formatting a source can the fold be kept?
I meant instead of expanding, keep the folded parts collapsed.
thanks.
Second, there would have to be an elegant solution if the folding tree changes when the code gets formatted. I don't know if there are any AStyle settings that would change the folding tree, but even if there are none, that doesn't guarantee that the tree will never change in future versions of AStyle.
Sourcecode formatting is just for readability and is not allowed to change the blocks in the code. For example a function is a function egally how it is formatted.
That means folding should never be changed by formatting, the only thing that can change is the line wher the folding starts or end.
if ( x )
{
DoSomething();
}
if ( x ) { DoSomething(); }
You are right ! :oops:
The problem wit source-code formatting and folding is, that the FoldingLevel is saved on a per line base in wxScintilla, but if the code gets formatted the line-count (in most times) change.
That means a backup of the Foldinglevels is quiet difficult.
As for the folding stuff: I clearly vote against it. It makes the code far too complex and has just to less in result.
Some devs are already really unhappy with the complexity that got into C::B in recent times because of each and every "flexibility feature" was added no matter
whether this is valuable or not.
Anyways - this feature *can* be implemented as plugin... so whoever wants to I won't stop you. But please: No changes in the core for such.