<body><div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000">
This was the bug:<div><br></div><div><img id="4fefe7ef-e618-4630-a427-0ad92dd85a17" src="cid:656e6ee1-e010-4fdd-a330-5a82c24d9f48" width="auto"></img><br></div><div><br></div><div>Yet, I am not sure why that #ensure: block had such a strange side effect in #evaluateSelectionAndDo:. Because only the last line in the method creates and selects that print-it string.</div><div><br></div><div>Best,</div><div>Marcel</div><div><br></div><div>Best,</div><div>Marcel</div><div class="mb_sig"></div><blockquote class="history_container" type="cite" style="border-left-style:solid;border-width:1px; margin-top:20px; margin-left:0px;padding-left:10px;">
<p style="color: #AAAAAA; margin-top: 10px;">Am 13.12.2019 10:02:47 schrieb commits@source.squeak.org <commits@source.squeak.org>:</p><div style="font-family:Arial,Helvetica,sans-serif">Marcel Taeumel uploaded a new version of Morphic to project The Trunk:<br>http://source.squeak.org/trunk/Morphic-mt.1608.mcz<br><br>==================== Summary ====================<br><br>Name: Morphic-mt.1608<br>Author: mt<br>Time: 13 December 2019, 10:02:28.682784 am<br>UUID: aefd108e-0a66-0041-a417-669c5b08df12<br>Ancestors: Morphic-mt.1607<br><br>Fixes a small glitch that I introduced in the last commit.<br><br>=============== Diff against Morphic-mt.1607 ===============<br><br>Item was changed:<br> ----- Method: TextEditor>>evaluateSelectionAndDo: (in category 'do-its') -----<br> evaluateSelectionAndDo: aBlock<br> "Treat the current selection as an expression; evaluate it and invoke aBlock with the result."<br> <br> | result rcvr ctxt selectionInterval |<br> self lineSelectAndEmptyCheck: [^ nil].<br> <br> (model respondsTo: #evaluateExpression:) ifTrue: [<br> ^ aBlock value: (model perform: #evaluateExpression: with: self selection)].<br> <br> (model respondsTo: #doItReceiver) <br> ifTrue: [ rcvr := model doItReceiver.<br> ctxt := model doItContext]<br> ifFalse: [rcvr := ctxt := nil].<br> <br> selectionInterval := self selectionInterval.<br>+ result := [<br>- result := [[<br> rcvr class evaluatorClass new <br> evaluate: self selectionAsStream<br> in: ctxt<br> to: rcvr<br> environment: (model environment ifNil: [Smalltalk globals])<br> notifying: self<br> ifFail: [morph flash. ^ nil]<br> logged: true.<br> ] <br> on: OutOfScopeNotification <br>+ do: [ :ex | ex resume: true].<br>+ "The parser might change the current selection for interactive error correction."<br>+ self selectInterval: selectionInterval.<br>- do: [ :ex | ex resume: true]<br>- ]<br>- ensure: [<br>- "The parser might change the current selection for interactive error correction."<br>- self selectInterval: selectionInterval].<br> <br> (model respondsTo: #expressionEvaluated:result:) ifTrue: [<br> model perform: #expressionEvaluated:result: with: self selection with: result].<br> <br> ^aBlock value: result!<br><br><br></div></blockquote>
</div></body>