<body><div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000">
Hi Christoph,<div><br></div><div>-1</div><div><br></div><div>The print-it string has to be selected after the do-it so that one can easily delete it again. Otherwise, it would be quite cumbersome to do within-statement print-its. It know, that it got simpler because of "undo". Still...</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 07.12.2019 16:53:39 schrieb commits@source.squeak.org <commits@source.squeak.org>:</p><div style="font-family:Arial,Helvetica,sans-serif">A new version of Morphic was added to project The Inbox:<br>http://source.squeak.org/inbox/Morphic-ct.1606.mcz<br><br>==================== Summary ====================<br><br>Name: Morphic-ct.1606<br>Author: ct<br>Time: 7 December 2019, 4:53:17.106431 pm<br>UUID: 83ec1d59-dfa2-ca40-806d-809e76232100<br>Ancestors: Morphic-mt.1604<br><br>Restore original selection interval after any kind of do-it.<br><br>This is important if you print-it the following and skip the compiler hint:<br><br>| x |<br>x.<br>2<br><br>Before this commit, the answer was displayed just after x, not at the end of the snippet.<br><br>=============== Diff against Morphic-mt.1604 ===============<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>+ | selectionInterval result rcvr ctxt |<br>- | result rcvr ctxt |<br> self lineSelectAndEmptyCheck: [^ nil].<br>+ selectionInterval := self selectionInterval.<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> 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>+ self selectInterval: selectionInterval.<br>+ <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>