www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit b054af81c2c3fafdb085830881251ab2bc3e3b73
parent f07531a360d2874e85da9b4ac6f1ca01abc1d51a
Author: Ryan Culpepper <ryanc@racket-lang.org>
Date:   Sat, 19 Dec 2009 04:41:44 +0000

macro-debugger: pretty-print copied syntax

svn: r17355

original commit: be6fb953bc1c767927557484e2da2528d421ba60

Diffstat:
Mcollects/macro-debugger/syntax-browser/keymap.ss | 12+++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/collects/macro-debugger/syntax-browser/keymap.ss b/collects/macro-debugger/syntax-browser/keymap.ss @@ -1,6 +1,7 @@ #lang scheme/base (require scheme/class scheme/gui + scheme/pretty unstable/gui/notify "interfaces.ss" "partition.ss") @@ -54,11 +55,12 @@ (add-function "copy-syntax-as-text" (lambda (_ event) (define stx (send controller get-selected-syntax)) - (send the-clipboard set-clipboard-string - (if stx - (format "~s" (syntax->datum stx)) - "") - (send event get-time-stamp)))) + (when stx + (send the-clipboard set-clipboard-string + (let ([out (open-output-string)]) + (pretty-print (syntax->datum stx) out) + (get-output-string out)) + (send event get-time-stamp))))) (add-function "clear-syntax-selection" (lambda (i e)