Skip to content
5 changes: 2 additions & 3 deletions drracket-core-lib/drracket/private/syncheck/gui.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -2132,9 +2132,8 @@ If the namespace does not, they are colored the unbound color.
(define/public (syncheck:clear-error-message)
(define old-error-report-visible? error-report-visible?)
(turn-off-error-report)
(when old-error-report-visible?
(when (is-current-tab?)
(send (get-frame) hide-error-report))))
(when (and old-error-report-visible? (is-current-tab?))
(send (get-frame) hide-error-report)))

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I merged one of these before, but I'm not convinced of this one. The indentation savings in this example isn't serious but the and makes it a bit harder to read, especially since it is all on one line.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting. I find this kind of thing more readable because it's easier to check that the code following it is outside the when. But maybe there's some room for nuance about when the rule is worth applying. I'll give it some thought. Let me know if you see other instances of this rule that seem off to you.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this particular instance it is not helping that the two arguments to the "and" are on the same line. I think I would not see much difference between the two if the revised version had also taken 3 lines.

(define/public (syncheck:clear-highlighting)
(define definitions (get-defs))
Expand Down