[squeak-dev] The Inbox: Morphic-ct.1606.mcz

Thiede, Christoph Christoph.Thiede at student.hpi.uni-potsdam.de
Sun Dec 8 17:59:14 UTC 2019


Hi Marcel,


could you explain what you mean with "within-statement print-its"? This commit only ensures that after evaluating a section, the previous selection is restored. I could only think of the scenario that you turn off modal exclusivity of a dialog window and change something in the CodeHolder while the compiler is running. Do we want to support this scenario?


Best,

Christoph

________________________________
Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von Taeumel, Marcel
Gesendet: Sonntag, 8. Dezember 2019 15:44:33
An: John Pfersich via Squeak-dev
Betreff: Re: [squeak-dev] The Inbox: Morphic-ct.1606.mcz

Hi Christoph,

-1

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...

Best,
Marcel

Am 07.12.2019 16:53:39 schrieb commits at source.squeak.org <commits at source.squeak.org>:

A new version of Morphic was added to project The Inbox:
http://source.squeak.org/inbox/Morphic-ct.1606.mcz

==================== Summary ====================

Name: Morphic-ct.1606
Author: ct
Time: 7 December 2019, 4:53:17.106431 pm
UUID: 83ec1d59-dfa2-ca40-806d-809e76232100
Ancestors: Morphic-mt.1604

Restore original selection interval after any kind of do-it.

This is important if you print-it the following and skip the compiler hint:

| x |
x.
2

Before this commit, the answer was displayed just after x, not at the end of the snippet.

=============== Diff against Morphic-mt.1604 ===============

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."
+ | selectionInterval result rcvr ctxt |
- | result rcvr ctxt |
self lineSelectAndEmptyCheck: [^ nil].
+ selectionInterval := self selectionInterval.

(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].
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].
+ self selectInterval: selectionInterval.
+
-
(model respondsTo: #expressionEvaluated:result:) ifTrue: [
model perform: #expressionEvaluated:result: with: self selection with: result].

^aBlock value: result!


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20191208/b32b8ca3/attachment.html>


More information about the Squeak-dev mailing list