Recent

Poll

Should else/otherwise by default be configured ON or OFF for outlining?

ON: else/otherwise should be outlined together with case (options allow to turn it off)
9 (52.9%)
OFF: else/otherwise should NOT be outlined together with case (options allow to turn it on)
2 (11.8%)
OFF / Don't care: (I use outline but have "case..end" off)
0 (0%)
Don't care (I use outline, but am not decided)
3 (17.6%)
Don't care (I don't use outline at all)
3 (17.6%)

Total Members Voted: 17

Author Topic: Preference for outlining  (Read 727 times)

ASerge

  • Hero Member
  • *****
  • Posts: 2510
Re: Preference for outlining
« Reply #15 on: June 30, 2026, 08:14:34 pm »
E.g. a "finally" that was further in than the "try" would show TWO vertical lines.
Why? This is the same as the else keyword in a case block.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12513
  • Debugger - SynEdit - and more
    • wiki
Re: Preference for outlining
« Reply #16 on: June 30, 2026, 09:04:17 pm »
E.g. a "finally" that was further in than the "try" would show TWO vertical lines.
Why? This is the same as the else keyword in a case block.

Yes, and the case is also one structure. Well, if the case has a begin...end then that begin end will get its own line.

Or do you prefer all of the listed cases to show double lines?

See image (old effect). The try block has one single line. Why should the finally block have two?

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12513
  • Debugger - SynEdit - and more
    • wiki
Re: Preference for outlining
« Reply #17 on: June 30, 2026, 09:31:00 pm »
Attached an example of what it is now.

1) The finally => 1 line

2) If then versus if then begin
The "begin" can have the same color as the if/then. Because the "end" is always at the end of the if/then (or else). Well the ";" can be on a line further down...
=> as for the case/else (very last example), that is not the case. The "else" can take several statements, if the first is a compound begin/end, then there can still be others.

3) first "case" example => the begin in the "else" block has its own outline (the else does not have one as it is part of the "case"

3a) 2nd "case" example -> same about the "begin" in "else" => only this time the line for the begin is drawn on top of the "case" line
(look close, the line changes color)


Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12513
  • Debugger - SynEdit - and more
    • wiki
Re: Preference for outlining
« Reply #18 on: July 01, 2026, 11:35:08 am »
See image (old effect). The try block has one single line. Why should the finally block have two?

An alternative would be to finish the "try" at the finally, and start a new section only for the finally.

1) IMHO the "try" is ended by the "end" not by the "finally".  But that may be a matter of view? (at least for everyone’s personal editor behaviour, not for a language design level)

2) This would require changes to folding. The outline is based on the folding. If the outline should see the "finally" as end point of the "try" then folding a "try" would also only fold down to that "finally" (while currently it folds to the "end" statement)

Well actually, it could be decoupled with "hidden folds" for the outline...
Maybe there are other ways to decouple from folding, would need research.

Or would different folding behaviour for this actually be wanted?




Throwing in an unrelated idea, that has been living in the back of my head for a while (waiting for a good moment to steal its way onto my schedule).

So if anyone wants to throw in some feedback on that: "color groups" for the outline.

Example
- "Group 1", user groups try/finally/except, user sets different shade of red for different nesting levels
- "Group 2", user groups while/repeat/for, user sets different shade of blue for different nesting levels
- "Group 3" the rest. Any other color

Then when looking at your code, the colors immediately tell you:
- red-ish => code is governed by try/finally/except
- blue-ish => code is in some form of loop

 

TinyPortal © 2005-2018