From 4f27df3179aa5690ea8a53d78c984e47faeddc3b Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Thu, 22 Nov 2012 10:10:21 -0600 Subject: [PATCH] make the f2 button go find the definitions text, instead of assuming it was typed in the definitions text closes PR 13225 --- collects/drracket/private/syncheck/gui.rkt | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/collects/drracket/private/syncheck/gui.rkt b/collects/drracket/private/syncheck/gui.rkt index b46008bdd6..166b31a993 100644 --- a/collects/drracket/private/syncheck/gui.rkt +++ b/collects/drracket/private/syncheck/gui.rkt @@ -2027,7 +2027,22 @@ If the namespace does not, they are colored the unbound color. (send keymap add-function "show/hide blue boxes in upper-right corner" (λ (txt evt) - (send txt toggle-syncheck-docs))) + (when (is-a? txt editor<%>) + (let loop ([ed txt]) + (define c (send ed get-canvas)) + (cond + [c (let loop ([w c]) + (cond + [(is-a? w drracket:unit:frame<%>) + (send (send w get-definitions-text) toggle-syncheck-docs)] + [(is-a? w area<%>) + (loop (send w get-parent))]))] + [else + (define admin (send ed get-admin)) + (when (is-a? admin editor-snip-editor-admin<%>) + (define admin2 (send (send admin get-snip) get-admin)) + (when admin2 + (loop (send admin2 get-editor))))]))))) (send keymap map-function "f2" "show/hide blue boxes in upper-right corner")) ;; find-syncheck-text : text% -> (union #f (is-a?/c syncheck-text<%>))