12

The Delphi XE8 editor has visual cues so that you know which begin goes with which end. In our team, we have the convention of always put the begin on the same line as the owner clause.

Is there any way to have the visual cue aligned with the corresponding end instead of its begin?

Screenshot

UPDATE: This issue seems to be fixed in Delphi Seattle 10.

Pep
  • 1,957
  • 2
  • 24
  • 40
  • 7
    OMG, what a shocker!!!!!!! Just when I though I could not be surprised by the quality of the software that comes out of Emba....... – David Heffernan Apr 08 '15 at 14:14
  • 1
    @TLama I really hope that they don't bring all the instability of Castalia, as well as it's lame understanding of code formatting – David Heffernan Apr 08 '15 at 14:19
  • 1
    Doesn't Embarcadero have better things to do? They could have accomplished something much better and more flexible by just highlighting begin and end rather than blindly drawing a line which means nothing. I'm still waiting to be able to highlight a variable and have the code editor highlight all other instances of the same variable - etc. – Jerry Dodge Apr 08 '15 at 14:39
  • 6
    That's Castalia. Obviously nobody bothered to fix such crap (pardon my expression, but this is a long standing problem with Castalia and one of the reasons why I hate it). – gabr Apr 08 '15 at 15:09
  • 4
    harsh comments..if you don't like Castalia, turn it off.. – John Easley Apr 08 '15 at 16:09
  • 3
    @John I'd like a function like this, but only one that painted sane lines. These ones are bonkers. CnPack can get this right. I'm paying for this functionality. I'd like it to work well. – David Heffernan Apr 08 '15 at 16:52
  • 1
    CodeRush had a nice implementation that supported many code styles.. sad when it went away.. – John Easley Apr 08 '15 at 16:53
  • I think this "convention" is bad, reading the code is bad and the code becomes ugly. You already have an answer bellow, but i would try to change de "convention", just because its Delphi and the real convention is not begin in the same line of owner clause. – oPsDCadarn Apr 08 '15 at 20:14
  • 7
    Please do not try to ascribe anything the label of "real convention," @Opsdcadarn. Plenty of code that ships with Delphi uses ["K&R" style](http://en.wikipedia.org/wiki/Indent_style#K.26R_style) begin-end locations. Delphi and Pascal are not exclusively ["Allman"](http://en.wikipedia.org/wiki/Indent_style#Allman_style) style. There are multiple legitimate styles in Delphi, and any tool that only accommodate one is shortsighted, at best, especially if it's bundled by the IDE vendor. – Rob Kennedy Apr 09 '15 at 04:11
  • 1
    @Rob, as well as you can write all your code on a single line and blame the IDE for improper structure highlighting while we are at. [Object Pascal Style Guide](http://edn.embarcadero.com/article/10280) clearly says, *never place a begin statement on the same line with any other code*. If you don't take that style as a reference is upon you. – TLama Apr 10 '15 at 11:05
  • 2
    @TLama - There's not much point in referring to the 'style guide' you linked without emphasizing why it should be definitive.I don't see a single reason why anyone should be compelled to adhere to that style except for perhaps the fact that the document calls itself *standard*, which I find quite arrogant. – Sertac Akyuz Apr 10 '15 at 12:16
  • @Sertac, true, but if there is no official style specification, then why not take that one as *standard*. Major part of the Delphi source uses it. – TLama Apr 10 '15 at 13:56
  • Simple answer - change your convention! – penarthur66 May 12 '15 at 08:40
  • @SertacAkyuz It's the standard. All the source code on Delphi VCL adheres to that style guide. And JEDI style guide is just an variant of OPSL. – Fabricio Araujo Oct 23 '15 at 16:59

3 Answers3

15

Go to Castalia Options - Editor - Smart Highlighting. Set Structural highlighting mark hanging blocks to No

Uwe Raabe
  • 45,288
  • 3
  • 82
  • 130
6

This is not an answer but I think it's worth sharing - CNPack's corresponding block highlighting can get this right, see screenshot below:

enter image description here

Edwin Yip
  • 4,089
  • 4
  • 40
  • 86
0

= reported ====================================== http://qc.embarcadero.com/wc/qcmain.aspx?d=131086

mp3freak
  • 9
  • 1
  • Note that [QualityCentral has now been shut down](https://community.embarcadero.com/blogs/entry/quality-keeps-moving-forward), so you can't access `qc.embarcadero.com` links anymore. If you need access to old QC data, look at [QCScraper](http://www.uweraabe.de/Blog/2017/06/09/how-to-save-qualitycentral/). – Remy Lebeau Jun 09 '17 at 17:19