Smart Formatting Options

18 Jul 2012

The "Format" button is great, except that it formats the code in a way I don't like.

For example, it does this to my loops:

for (int i=0; i<10; i++)

I don't like the space.

Trivial as it may seem, formatting options can nethertheless be religious issues with programmers, as I'm sure you know.

Anyway, the suggestion is to have a couple of options around formatting style, such as:

1. Whether or not loops and statements are spaced as above. 2. Indentation width.

Just a thought.

18 Jul 2012

what about code folding, and the ability to higlite maching { .. }'s

and please can we have

while (1)
{
    // My code
}

and not (or a choice of)

while {
// My code
}

Cheers

Ceri

18 Jul 2012

I do not expect the online environment to provide my preferred formatting (I use Emacs and the request from Ceri is in line with my preferences), but I certainly would love to be able to use Emacs in the online environment! I do only trivial editing online.

I use Emacs locally for more than simple one line changes. This requires me to constantly syncronize my local files with the online files. I also have to use the Emacs formating functions to return the code to "my style" when I export the current working project files. My guess is the online formatting is consistent with the style recommended by K&R, and perhaps is preferred by the majority of folks. But I cannot even follow my own code when formatted this way.

So, this is not a request from me, just a comment in sympathy with Ceri. I must say that the import and export operations work very well so I am pleased with the environment. I have read information about support for compiling locally and am not sure if this will evolve to the point where I can develop locally using Emacs, but that would certainly be great if I still have full access to the libraries.

ceri clatworthy wrote:

what about code folding, and the ability to higlite maching { .. }'s

and please can we have <cut>

19 Jul 2012

Perhaps intents at 2, 3, or 4 spaces?