Christoph Thiede uploaded a new version of Morphic to project The Trunk: http://source.squeak.org/trunk/Morphic-ct.2126.mcz
==================== Summary ====================
Name: Morphic-ct.2126 Author: ct Time: 26 August 2023, 10:47:41.051023 pm UUID: fd9b4398-075b-8c40-b1a8-8997341cf46a Ancestors: Morphic-mt.2125
Fixes invalid state in text morphs when selecting text while something (e.g., a transcript) is updating the text.
E.g., you could trigger a nil errorNotIndexable from SmalltalkEditor(TextEditor)>>isDisjointFrom:) by doing this:
[[1 second wait. Transcript showln: DateAndTime now] repeat] forkAt: Processor userBackgroundPriority. "Drag to select text, wait for the next update, and release the cursor outside the window"
Make sure not to have any stepping morphs (such as browsers) in the world to reproduce this. #forceScreen does not need to be enabled.
Note that this is not a concurrency issue but also occurs when writing to the transcript from the UI process only. In general, you should not manipulate (or even access?) morphic UI state from other processes.
=============== Diff against Morphic-mt.2125 ===============
Item was changed: ----- Method: TextEditor>>mouseUp: (in category 'events') ----- mouseUp: evt "An attempt to break up the old processRedButton code into threee phases"
"0) Click on text actions." (self mouseUpOnTextAction: evt) ifTrue: [^ self].
"1) A 'double-click' will result in selecting the whole word." (self hasCaret and: [oldInterval = self selectionInterval]) ifTrue: [self selectWord]. "2) For the next type-in, configure emphasis. We don't want to do this on every key-press for performance reasons." self setEmphasisHere. "3) Notice selection changes." + (oldInterval notNil "happens if the editor has been replaced since mouseDown: (e.g., by a programmatic text change such as #appendEntry)" + and: [self isDisjointFrom: oldInterval]) + ifTrue: [otherInterval := oldInterval]. - (self isDisjointFrom: oldInterval) - ifTrue: [otherInterval := oldInterval]. self storeSelectionInParagraph.
"4) Reset mouse cursor to account for selection changes." self updateCursorForEvent: evt. morph removeProperty: #waitingForTextDrag.!
packages@lists.squeakfoundation.org