[squeak-dev] The Trunk: ToolBuilder-Morphic-mt.307.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Mar 14 14:56:01 UTC 2022

Marcel Taeumel uploaded a new version of ToolBuilder-Morphic to project The Trunk:

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

Name: ToolBuilder-Morphic-mt.307
Author: mt
Time: 14 March 2022, 3:55:59.386786 pm
UUID: 868f58df-817b-944f-9a78-556889a10131
Ancestors: ToolBuilder-Morphic-mt.306

Fixes a very old glitch in our accept-text code. We must use #text, not #asText, when accessing the pur textual contents from the textMorph to get its unstyled contents. It's not about "conversion" here, just "accessing".

=============== Diff against ToolBuilder-Morphic-mt.306 ===============

Item was changed:
  ----- Method: PluggableTextMorphPlus>>acceptTextInModel (in category 'styling') -----
  	self okToStyle ifFalse:[^super acceptTextInModel].			
  	"#correctFrom:to:with: is sent when the method source is
  	manipulated during compilation (removing unused temps,
  	changing selectors etc). But 	#correctFrom:to:with: operates 
  	on the textMorph's text, and we may be saving an unstyled 
  	copy of the text. This means that these corrections will be lost
+ 	unless we also apply the corrections to the unstyled copy that
+ 	we are saving.
- 	unless we also apply the corrections to the unstyled copy that we are saving.
  		So remember the unstyled copy in unstyledAcceptText, so
  	that when #correctFrom:to:with: is received we can also apply
  	the correction to it"
+ 	unstyledAcceptText := styler unstyledTextFrom: textMorph text.
- 	unstyledAcceptText := styler unstyledTextFrom: textMorph asText.
  	[^setTextSelector isNil or:
  		[setTextSelector numArgs = 2
  			ifTrue: [model perform: setTextSelector with: unstyledAcceptText with: self]
  			ifFalse: [model perform: setTextSelector with: unstyledAcceptText]]
  	] ensure:[unstyledAcceptText := nil]!

More information about the Squeak-dev mailing list