<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body>
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p>I think I understand the bug and its fix, but I don't understand your comment about the "strange side effect":</p>
<p>Afaik compilation error strings are generated by the parser (see #notify:at:[in:])? So before your latest commit, the following happened:</p>
<p></p>
<ol style="margin-bottom: 0px; margin-top: 0px;">
<li>#notify:at:in: prints the error string</li><li>the fail block [morph flash. ^ nil] is evaluated</li><li>while returning, the ensure block is called to restore the previous selection</li><li>the do block passed from #printIt is *not* called, so the selection will not be changed again.</li></ol>
<div>So what side effect are you referring to? :-)</div>
<div><br>
</div>
<div>Best,</div>
<div>Christoph</div>
<p></p>
<div id="Signature">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div><font size="2" color="#808080"></font></div>
</div>
</div>
</div>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von Taeumel, Marcel<br>
<b>Gesendet:</b> Freitag, 13. Dezember 2019 10:11:07<br>
<b>An:</b> John Pfersich via Squeak-dev<br>
<b>Betreff:</b> Re: [squeak-dev] The Trunk: Morphic-mt.1608.mcz</font>
<div> </div>
</div>
<div>
<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" width="auto" src="cid:656e6ee1-e010-4fdd-a330-5a82c24d9f48"><!-- </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>
</div>
</body>
</html>