From 6624bc1dea82dde86a545a1ff6e0bc3215113499 Mon Sep 17 00:00:00 2001 From: Danny Yoo Date: Thu, 26 Jun 2008 20:22:16 +0000 Subject: [PATCH] Recommitting fix to showing error highlighting on embeded snips. svn: r10463 --- collects/drscheme/private/debug.ss | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/collects/drscheme/private/debug.ss b/collects/drscheme/private/debug.ss index f20fa1f1cf..9d2206ad82 100644 --- a/collects/drscheme/private/debug.ss +++ b/collects/drscheme/private/debug.ss @@ -764,9 +764,7 @@ profile todo: [frame (cond [(path? debug-source) (handler:edit-file debug-source)] [(is-a? debug-source editor<%>) - (let ([canvas (send debug-source get-canvas)]) - (and canvas - (send canvas get-top-level-window)))] + (get-enclosing-editor-frame debug-source)] [else #f])] [editor (cond [(path? debug-source) @@ -789,6 +787,23 @@ profile todo: + ;; get-enclosing-editor-frame: editor<%> -> (or/c frame% #f) + ;; Returns the enclosing frame of an-editor, or #f if we can't find it. + (define (get-enclosing-editor-frame an-editor) + (let ([admin (send an-editor get-admin)]) + (cond + [(is-a? admin editor-snip-editor-admin<%>) + (let* ([enclosing-editor-snip (send admin get-snip)] + [editor-snip-admin (send enclosing-editor-snip get-admin)] + [enclosing-editor (send editor-snip-admin get-editor)]) + (get-enclosing-editor-frame enclosing-editor))] + [else + (let ([canvas (send an-editor get-canvas)]) + (and canvas + (send canvas get-top-level-window)))]))) + + + ; ; ;