From 072ea01f22cbc609aab67bbeda795b4dc67fc2c2 Mon Sep 17 00:00:00 2001 From: Danny Yoo Date: Thu, 26 Jun 2008 23:48:44 +0000 Subject: [PATCH] Maintaining text% as syntax source, so that check-syntax on an unsaved file will highlight errors correctly. svn: r10468 --- collects/drscheme/private/embedded-snip-utils.ss | 3 ++- collects/drscheme/private/eval.ss | 3 +-- collects/drscheme/private/unit.ss | 3 +-- collects/drscheme/syncheck.ss | 3 ++- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/collects/drscheme/private/embedded-snip-utils.ss b/collects/drscheme/private/embedded-snip-utils.ss index 22ad98e957..c8cf3b7504 100644 --- a/collects/drscheme/private/embedded-snip-utils.ss +++ b/collects/drscheme/private/embedded-snip-utils.ss @@ -16,7 +16,8 @@ (let txt-loop ([text defs-text]) (cond [(and (is-a? text text:basic<%>) - (send text port-name-matches? a-stx-source)) + (or (send text port-name-matches? a-stx-source) + (eq? text a-stx-source))) text] [else (let snip-loop ([snip (send text find-first-snip)]) diff --git a/collects/drscheme/private/eval.ss b/collects/drscheme/private/eval.ss index 87b5ad3f6e..343ff75d70 100644 --- a/collects/drscheme/private/eval.ss +++ b/collects/drscheme/private/eval.ss @@ -46,8 +46,7 @@ (let* ([text (drscheme:language:text/pos-text input)] [start (drscheme:language:text/pos-start input)] [end (drscheme:language:text/pos-end input)] - [text-port (open-input-text-editor text start end values - (send text get-port-name))]) + [text-port (open-input-text-editor text start end values text)]) (port-count-lines! text-port) (let* ([line (send text position-paragraph start)] [column (- start (send text paragraph-start-position line))] diff --git a/collects/drscheme/private/unit.ss b/collects/drscheme/private/unit.ss index c6877ac9e3..fc07988331 100644 --- a/collects/drscheme/private/unit.ss +++ b/collects/drscheme/private/unit.ss @@ -2144,8 +2144,7 @@ module browser threading seems wrong. (let ([start 0]) (send definitions-text split-snip start) - (let* ([name (send definitions-text get-port-name)] - [text-port (open-input-text-editor definitions-text start 'end values name)]) + (let* ([text-port (open-input-text-editor definitions-text start 'end values definitions-text #t)]) (port-count-lines! text-port) (let* ([line (send definitions-text position-paragraph start)] [column (- start (send definitions-text paragraph-start-position line))] diff --git a/collects/drscheme/syncheck.ss b/collects/drscheme/syncheck.ss index 40d252921a..b007d7ca8b 100644 --- a/collects/drscheme/syncheck.ss +++ b/collects/drscheme/syncheck.ss @@ -2432,7 +2432,8 @@ If the namespace does not, they are colored the unbound color. (syntax-source stx))) text] [(and (is-a? text fw:text:basic<%>) - (send text port-name-matches? (syntax-source stx))) + (or (eq? text (syntax-source stx)) + (send text port-name-matches? (syntax-source stx)))) (hash-set! source-editor-cache text (syntax-source stx)) text] [else