MarkF
MarkF

Reputation: 1646

Is there a way to change the default generated code wrapping width in the Delphi IDE Editor?

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!

Upvotes: 2

Views: 1662

Answers (4)

Artem
Artem

Reputation: 23

For Formatter:

Tools > Options - Formatter > Delphi > Line breaks - General > Right margin

Upvotes: 2

Deltics
Deltics

Reputation: 23036

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.

Upvotes: 1

Francesca
Francesca

Reputation: 21640

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);

Upvotes: 11

skamradt
skamradt

Reputation: 15538

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.

Upvotes: 3

Related Questions