I do not understand why but it looks really a problem with text selection
It's not a problem with text selection.
The problem is that profStef next changes the contents of the morph (with setText:). Nothing anormal here but, while doing so it kills the editor from where the selection is evaluated.
See the portion of #evaluateSelection  given below:
--------------------
evaluateSelection
 ...
    result := [
        rcvr class evaluatorClass new
            evaluate: self selectionForDoitAsStream
            in: ctxt
            to: rcvr
            notifying: self <------***** the problem is here *****
            ifFail: [FakeClassPool adopt: nil. ^ #failedDoit]
            logged: true.
    ]
...
-----------------
The receiver is passed as the requestor and it is bad because after the selection has been evaluated,
the receiver is destroyed by the #setText: and a new editor is built.
After having evaluated the selection, the compiler sends several messages to the requestor.
Then it crashes because the requestor is destroyed by the evaluation ... :)
So the solution is to set the editor morph as the requestor (which is stable), not the editor.

Cheers
Alain


Reply via email to