Skip to content

Commit abfbb88

Browse files
committed
adjust snips to copy and paste strings
related to #776
1 parent 110782d commit abfbb88

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

drracket-core-lib/drracket/private/debug.rkt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@
214214
(define get-editions :get-editions)
215215

216216
;; make-note% : string -> (union class #f)
217-
(define (make-note% filename bitmap)
217+
(define (make-note% filename bitmap [str #f])
218218
(and (send bitmap ok?)
219219
(letrec ([note%
220220
(class* clickable-image-snip% (srclocs-special<%>)
@@ -234,11 +234,19 @@
234234
(send n set-stacks stack1 stack2)
235235
(send n set-srclocs srclocs)
236236
n))
237+
(define/override (get-text offset num flattened?)
238+
(cond
239+
[str
240+
(define end (+ offset num))
241+
(if (and (= offset 0) (= end (string-length str)))
242+
str
243+
(substring str (max offset 0) (min end (string-length str))))]
244+
[else (super get-text offset num flattened?)]))
237245
(super-make-object bitmap))])
238246
note%)))
239247

240248
(define file-note%
241-
(make-note% "stop-22x22.png" (compiled-bitmap (stop-sign-icon #:color halt-icon-color))))
249+
(make-note% "stop-22x22.png" (compiled-bitmap (stop-sign-icon #:color halt-icon-color)) "🛑"))
242250
(define bug-note%
243251
(make-note% "stop-multi.png" (compiled-bitmap (stop-signs-icon #:color halt-icon-color))))
244252

0 commit comments

Comments
 (0)