From 7816a6899c6faff8d29231040f6d7c74af816006 Mon Sep 17 00:00:00 2001 From: Danny Yoo Date: Sun, 6 Jul 2008 21:47:54 +0000 Subject: [PATCH] Added logic to treat embedded editors differently when computing tail call arrow positions in Check Syntax. svn: r10634 --- collects/drscheme/syncheck.ss | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/collects/drscheme/syncheck.ss b/collects/drscheme/syncheck.ss index 5c1102e1b0..a7b4ba3fac 100644 --- a/collects/drscheme/syncheck.ss +++ b/collects/drscheme/syncheck.ss @@ -353,20 +353,32 @@ If the namespace does not, they are colored the unbound color. (set-arrow-end-x! arrow end-x) (set-arrow-end-y! arrow end-y))) + (define/private (update-tail-arrow-poss arrow) - (let-values ([(start-x start-y) (find-poss + ;; If the item is an embedded editor snip, redirect + ;; the arrow to point at the left edge rather than the + ;; midpoint. + (define (find-poss/embedded text pos) + (let* ([snip (send text find-snip pos 'after)]) + (cond + [(and snip + (is-a? snip editor-snip%) + (= pos (send text get-snip-position snip))) + (find-poss text pos pos)] + [else + (find-poss text pos (+ pos 1))]))) + (let-values ([(start-x start-y) (find-poss/embedded (tail-arrow-from-text arrow) - (tail-arrow-from-pos arrow) - (+ (tail-arrow-from-pos arrow) 1))] - [(end-x end-y) (find-poss + (tail-arrow-from-pos arrow))] + [(end-x end-y) (find-poss/embedded (tail-arrow-to-text arrow) - (tail-arrow-to-pos arrow) - (+ (tail-arrow-to-pos arrow) 1))]) + (tail-arrow-to-pos arrow))]) (set-arrow-start-x! arrow start-x) (set-arrow-start-y! arrow start-y) (set-arrow-end-x! arrow end-x) (set-arrow-end-y! arrow end-y))) + ;; syncheck:init-arrows : -> void (define/public (syncheck:init-arrows) (set! tacked-hash-table (make-hasheq))