Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1608.mcz ==================== Summary ==================== Name: Morphic-mt.1608 Author: mt Time: 13 December 2019, 10:02:28.682784 am UUID: aefd108e-0a66-0041-a417-669c5b08df12 Ancestors: Morphic-mt.1607 Fixes a small glitch that I introduced in the last commit. =============== Diff against Morphic-mt.1607 =============== Item was changed: ----- Method: TextEditor>>evaluateSelectionAndDo: (in category 'do-its') ----- evaluateSelectionAndDo: aBlock "Treat the current selection as an expression; evaluate it and invoke aBlock with the result." | result rcvr ctxt selectionInterval | self lineSelectAndEmptyCheck: [^ nil]. (model respondsTo: #evaluateExpression:) ifTrue: [ ^ aBlock value: (model perform: #evaluateExpression: with: self selection)]. (model respondsTo: #doItReceiver) ifTrue: [ rcvr := model doItReceiver. ctxt := model doItContext] ifFalse: [rcvr := ctxt := nil]. selectionInterval := self selectionInterval. + result := [ - result := [[ rcvr class evaluatorClass new evaluate: self selectionAsStream in: ctxt to: rcvr environment: (model environment ifNil: [Smalltalk globals]) notifying: self ifFail: [morph flash. ^ nil] logged: true. ] on: OutOfScopeNotification + do: [ :ex | ex resume: true]. + "The parser might change the current selection for interactive error correction." + self selectInterval: selectionInterval. - do: [ :ex | ex resume: true] - ] - ensure: [ - "The parser might change the current selection for interactive error correction." - self selectInterval: selectionInterval]. (model respondsTo: #expressionEvaluated:result:) ifTrue: [ model perform: #expressionEvaluated:result: with: self selection with: result]. ^aBlock value: result! |
This was the bug: 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. Best, Marcel Best, Marcel
|
I think I understand the bug and its fix, but I don't understand your comment about the "strange side effect": Afaik compilation error strings are generated by the parser (see #notify:at:[in:])? So before your latest commit, the following happened:
So what side effect are you referring to? :-)
Best,
Christoph
Von: Squeak-dev <[hidden email]> im Auftrag von Taeumel, Marcel
Gesendet: Freitag, 13. Dezember 2019 10:11:07 An: John Pfersich via Squeak-dev Betreff: Re: [squeak-dev] The Trunk: Morphic-mt.1608.mcz
This was the bug:
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.
Best,
Marcel
Best,
Marcel
Carpe Squeak!
|
> the fail block [morph flash. ^ nil] is evaluated Ah, that was it. Thanks. Best, Marcel
|
Free forum by Nabble | Edit this page |