Skip to content

Commit cccbe1f

Browse files
committed
add adornments only at the end of the string. #3965
1 parent 2651bc9 commit cccbe1f

4 files changed

+28
-14
lines changed

lepiter/akzy87sfo25ew7howpf8depta.lepiter

+2-2
Original file line numberDiff line numberDiff line change
@@ -322,14 +322,14 @@
322322
"__type" : "time",
323323
"time" : {
324324
"__type" : "dateAndTime",
325-
"dateAndTimeString" : "2023-09-19T23:47:04.865685+02:00"
325+
"dateAndTimeString" : "2024-08-20T20:02:14.096337+02:00"
326326
}
327327
},
328328
"uid" : {
329329
"__type" : "uid",
330330
"uidString" : "e6C51z1uAAAAAAAAAAAAAA=="
331331
},
332-
"code" : "dictionary := STON fromString: json."
332+
"code" : "dictionary := STONJSON fromString: json."
333333
},
334334
{
335335
"__type" : "textSnippet",

src/GToolkit-Transcript/GtTranscript.class.st

+5-2
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,12 @@ GtTranscript >> initialize [
106106
]
107107

108108
{ #category : #'private - actions' }
109-
GtTranscript >> insertString: aString withAttributes: aCollection [
109+
GtTranscript >> insertString: aString withAttributesForWholeString: aCollection withAttributesAtTheEnd: aCollection2 [
110110
self textDo: [ :aText |
111-
aText append: (aString asRopedText attributes: aCollection).
111+
| toAppend |
112+
toAppend := aString asRopedText attributes: aCollection.
113+
(toAppend from: toAppend size to: toAppend size) attributes: aCollection2.
114+
aText append: toAppend.
112115
self announcer announce: (GtTranscriptInsertStringAnnouncement new
113116
string: aString;
114117
attributes: aCollection) ]

src/GToolkit-Transcript/GtTranscriptExamples.class.st

+2-4
Original file line numberDiff line numberDiff line change
@@ -341,15 +341,13 @@ GtTranscriptExamples >> transcriptWitAnimation [
341341
do: [ :anEvent |
342342
| snapshot |
343343
snapshot := animation target asSpartaForm.
344+
transcript cr.
344345
transcript next
345-
cr;
346346
expanded: [ BlElement new
347347
constraintsDo: [ :c | c textFlow pushLine ];
348348
size: snapshot extent;
349349
background: snapshot ];
350-
putAll: 'Animation progress:';
351-
space;
352-
putAll: anEvent progress asString.
350+
putAll: 'Animation progress: ', anEvent progress asString.
353351
animation target asSpartaForm extent ];
354352
onFinishedDo: [ space close ].
355353

src/GToolkit-Transcript/GtTranscriptNextBuilder.class.st

+19-6
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,22 @@ Class {
2020
#instVars : [
2121
'transcript',
2222
'adornmentStrategy',
23-
'attributes'
23+
'attributes',
24+
'adornments'
2425
],
2526
#category : #'GToolkit-Transcript'
2627
}
2728

29+
{ #category : #attributes }
30+
GtTranscriptNextBuilder >> adornment: anAdornment [
31+
adornments add: anAdornment
32+
]
33+
34+
{ #category : #attributes }
35+
GtTranscriptNextBuilder >> adornments: aCollection [
36+
adornments addAll: aCollection
37+
]
38+
2839
{ #category : #attributes }
2940
GtTranscriptNextBuilder >> attribute: anAttribute [
3041
attributes add: anAttribute
@@ -63,7 +74,7 @@ GtTranscriptNextBuilder >> expanded: aBlock [
6374
beAppend;
6475
stencil: aBlock.
6576

66-
self attributes: {
77+
self adornments: {
6778
BrGlamorousTriangleExpanderTextAttribute new
6879
isExpanded: true;
6980
createdAttributes: { adornmentAttribute };
@@ -76,7 +87,7 @@ GtTranscriptNextBuilder >> expanded: aBlock [
7687

7788
{ #category : #attributes }
7889
GtTranscriptNextBuilder >> expanding: aBlock [
79-
self attribute: (
90+
self adornment: (
8091
BrGlamorousTriangleExpanderTextAttribute new
8192
attributesCreatingBlock: [
8293
BrTextAdornmentDynamicAttribute new
@@ -97,7 +108,8 @@ GtTranscriptNextBuilder >> foreground: aColor [
97108

98109
{ #category : #initialize }
99110
GtTranscriptNextBuilder >> initialize [
100-
attributes := OrderedCollection with: (BlFontFamilyAttribute named: 'Source Code Pro')
111+
attributes := OrderedCollection with: (BlFontFamilyAttribute named: 'Source Code Pro').
112+
adornments := OrderedCollection new
101113
]
102114

103115
{ #category : #attributes }
@@ -122,11 +134,12 @@ GtTranscriptNextBuilder >> put: aCharacter [
122134

123135
{ #category : #streaming }
124136
GtTranscriptNextBuilder >> putAll: aString [
125-
126137
"We should only modify the editor from within the UI thread"
138+
127139
transcript
128140
insertString: aString
129-
withAttributes: attributes
141+
withAttributesForWholeString: attributes
142+
withAttributesAtTheEnd: adornments
130143
]
131144

132145
{ #category : #streaming }

0 commit comments

Comments
 (0)