| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| I have this three indented lines: for i := 1 to 10 do begin DoSomething; end {for}; If I select them, and right-click ''surround tryf'', I get this: try for i := 1 to 10 do begin DoSomething; end {for}; finally end; The selected code indentation is increased, which is correct, but the try/finally/end is not indented at the former code indentation. Is that the intended behaviour? I would have expected this: try for i := 1 to 10 do begin DoSomething; end {for}; finally end; Chris |
|
#2
| |||
| |||
| Chris wrote: > I have this three indented lines: > > for i := 1 to 10 do begin > DoSomething; > end {for}; > > If I select them, and right-click ''surround tryf'', I get this: > > try > for i := 1 to 10 do begin > DoSomething; > end {for}; > > finally > end; > > The selected code indentation is increased, which is correct, but the > try/finally/end is not indented at the former code indentation. Is > that the intended behaviour? The resulting alignment is a bit random <g>, the template engine is not quite up to the task here. If you select comlete lines you get what you observered, with the try..finally positioned in column 0. If you start the selection on the "f" of the for and extend it to the semicolon after the end comment you get something a bit closer to what one would expect: the finally end is aligned on the old column of the for but the try ends up directly above the for, so one indentation level to far to the right. -- Peter Below (TeamB) Don't be a vampire (http://slash7.com/pages/vampires), use the newsgroup archives : http://www.tamaracka.com/search.htm http://groups.google.com |
|
#3
| |||
| |||
| Hello Chris, > The selected code indentation is increased, which is correct, but the try/finally/end is not indented at the former code > indentation. Is that the intended behaviour? As Peter mentioned : " The resulting alignment is a bit random " If you want better surround templates, check ModelMaker Code Explorer: http://www.modelmakertools.com/code-explorer/index.html This allows controlling the indent per template (and even unindent the template) allows surrounds in a single line (FreeAndNil(..), Format(...) and has two dedicated surrounds: try finally wizard: this inserts finalization code based on the code before try. block wizard: this surrounds a selection with a beginend bloc, determining the indent automatically. Both and several other "minor" features are demo-ed in this movie: http://modelmakertools.com/movies/beyond-templates.htm The try finally wizard is at about 3/4... Gerrit Beuze ModelMaker Tools |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.