From d1357f229430f6288d037791782b00b441cad4cb Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Tue, 12 Feb 2013 13:44:44 -0600 Subject: [PATCH] avoid a wrapper on callbacks that get stored in a weak table This fixes a bug in DrRacket where by changing the font size would cause the line numbers to encroach on the space allotted to the main text of the definitions window (or, if the font size is getting smaller, make a large gap) --- collects/racket/snip/private/contract.rkt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/collects/racket/snip/private/contract.rkt b/collects/racket/snip/private/contract.rkt index 0647510311..422a9a60a4 100644 --- a/collects/racket/snip/private/contract.rkt +++ b/collects/racket/snip/private/contract.rkt @@ -133,6 +133,10 @@ (set-weight-off (->m font-weight/c void?)) (set-weight-on (->m font-weight/c void?)))) +(define (arity-1-procedure? x) + (and (procedure? x) + (procedure-arity-includes? x 1))) + (define style-list%/c (class/c (basic-style (->m (is-a?/c style<%>))) @@ -143,7 +147,7 @@ (forget-notification (->m any/c void?)) (index-to-style (->m exact-nonnegative-integer? (or/c (is-a?/c style<%>) false/c))) (new-named-style (->m string? (is-a?/c style<%>) (is-a?/c style<%>))) - (notify-on-change (->m (-> (or/c (is-a?/c style<%>) false/c) any) any/c)) + (notify-on-change (->m arity-1-procedure? any/c)) (number (->m exact-nonnegative-integer?)) (replace-named-style (->m string? (is-a?/c style<%>) (is-a?/c style<%>))) (style-to-index (->m (is-a?/c style<%>) (or/c exact-nonnegative-integer? false/c)))))