[squeak-dev] The Trunk: Morphic-ct.1959.mcz

commits at source.squeak.org commits at source.squeak.org
Thu May 5 17:30:53 UTC 2022

Christoph Thiede uploaded a new version of Morphic to project The Trunk:

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

Name: Morphic-ct.1959
Author: ct
Time: 2 April 2022, 7:56:53.015869 pm
UUID: 1f80acc4-dd90-8a47-b327-cea807b2e8f3
Ancestors: Morphic-ul.1956

Resets emphasis when cancelling the edits in a text morph.

This bug can be reproduced by doing:
	'plonk' edit.
And then pressing <opt>7, <opt>0 into the editor.

MVC was not affected by this bug, I checked.

Please review.

=============== Diff against Morphic-ul.1956 ===============

Item was changed:
  ----- Method: PluggableTextMorph>>cancelSafely (in category 'menu commands') -----
  	"Cancel all edits by replacing the content with the original contents. Retain the undo history. The model can intervene via #okToRevertChanges, which is beneficial if all edits have already be communicated via #textEdited: so that the model can cancel its internal caches."
  	(model respondsTo: #okToRevertChanges:) ==> [model okToRevertChanges: editTextSelector]
  		ifFalse: [^ self].
  	self handleEdit: [
+ 		textMorph editor
+ 			resetEmphasisHere;
+ 			replaceAllWith: self getText.
- 		textMorph editor replaceAllWith: self getText.
  		self selectInterval: self getSelection.
  		self hasUnacceptedEdits: false.
  		self hasUserEdited: false].!

Item was added:
+ ----- Method: TextEditor>>resetEmphasisHere (in category 'typing support') -----
+ resetEmphasisHere
+ 	emphasisHere := #().!

More information about the Squeak-dev mailing list