views:

201

answers:

3

Now that I have a widescreen monitor, I can't seem to find a way to make the Delphi IDE wrap generated code at anything other than 80 chars. I've set the "Right margin" setting in the IDE Editor options to a high value, but it doesn't appear to affect the wrapping that happens on generated events and code lines. Does anyone know of a way to set it? Perhaps a hidden registry setting? Alternately, are there any IDE addons that do this? Thanks for any suggestions!

+2  A: 

Those events which are inserted using code templates can be modified by editing the template files (they are xml documents in the C:\Program Files\CodeGear\RAD Studio\xxxx\ObjRepos\Code_Templates\Delphi directory)

As far as I know there is no plugin or setting to change where generated code wraps outside of templates.

skamradt
Thanks. I meant code inserted by selecting VCL events or class completion, not live templates.
MarkF
I covered both, I believe that the generated code from VCL events or class completion is hard coded at 80 and that there is no current setting to change this.
skamradt
+10  A: 

In D2007 and up, setting Tools|Options|Editor Options|Display|Right margin to 100 causes the event generated from the Object Inspector to wrap after the 100th character...

I just tried :

procedure TForm7.AVeryLongMethodNameqwertyuiopasdfghjklzxcvbnm(Sender: TObject; Shift: TShiftState;
  MousePos: TPoint; var Handled: Boolean);
François
Same in D2006. Galileo DOES have some advantages over D7 (would hate to lose refactoring and SyncEdit as well)
Gerry
Thanks! I just tested on D2009 and you are right on. I thought I had already tested that, but I must have been looking at an event I generated with the lower setting. Much appreciated.
MarkF
+1  A: 

Until the IDE offers a little more flexibility or configuration in this area, one option might be to use a code formatting tool to tidy up the code inserted by the IDE.

Delphi 2010 will come with a highly configurable code formatter "built in", but there are other alternatives available now. One which comes with an IDE plug-in is the JEDI Code Formatter, and the information pages for that contain references to other alternatives which may be of help even if the JEDI solution itself is not.

Deltics
Thanks! I'll have to take a look at those.
MarkF