[Pkg] The Trunk: Morphic-mt.1564.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Oct 9 15:45:06 UTC 2019

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

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

Name: Morphic-mt.1564
Author: mt
Time: 9 October 2019, 5:44:57.15939 pm
UUID: 9a335eec-8415-7547-bb8b-09b7249b052c
Ancestors: Morphic-mt.1563

I forgot a flag in Morphic-mt.1563.

=============== Diff against Morphic-mt.1563 ===============

Item was changed:
  ----- Method: TextMorph>>updateFromParagraph (in category 'private') -----
  	"A change has taken place in my paragraph, as a result of editing and I must be updated.  If a line break causes recomposition of the current paragraph, or it the selection has entered a different paragraph, then the current editor will be released, and must be reinstalled with the resulting new paragraph, while retaining any editor state, such as selection, undo state, and current typing emphasis."
  	| newStyle sel oldLast oldEditor back |
  	paragraph ifNil: [^self].
  	wrapFlag ifNil: [wrapFlag := true].
  	editor ifNotNil: 
  			[oldEditor := editor.
  			sel := editor selectionInterval.
  			editor storeSelectionInParagraph].
  	text := paragraph text.
  	paragraph textStyle = textStyle 
  		ifTrue: [self fit]
  			["Broadcast style changes to all morphs"
  			newStyle := paragraph textStyle.
  			(self firstInChain text: text textStyle: newStyle) recomposeChain.
  			editor ifNotNil: [self installEditorToReplace: editor]].
  	(self isAutoFit and: [self isWrapped not])
  		ifTrue: [self extent: self paragraph extent; composeToBounds]
  		ifFalse: [self layoutChanged].
  	sel ifNil: [^self].
  	"If selection is in top line, then recompose predecessor for possible ripple-back"
  	predecessor ifNotNil: 
  			[sel first <= (self paragraph lines first last + 1) 
  					[oldLast := predecessor lastCharacterIndex.
  					predecessor paragraph 
  						recomposeFrom: oldLast
  						to: text size
  						delta: 0.
  					oldLast = predecessor lastCharacterIndex 
  							[predecessor changed.	"really only last line"
  							self predecessorChanged]]].
  	((back := predecessor notNil 
  				and: [sel first <= self paragraph firstCharacterIndex]) or: 
  				[successor notNil 
  					and: [sel first > (self paragraph lastCharacterIndex + 1)]]) 
  			["The selection is no longer inside this paragraph.
  		Pass focus to the paragraph that should be in control."
  			back ifTrue: [predecessor recomposeChain] ifFalse: [self recomposeChain].
  			self firstInChain withSuccessorsDo: 
  					[:m | 
  					(sel first between: m firstCharacterIndex and: m lastCharacterIndex + 1) 
  							[m installEditorToReplace: oldEditor.
  							^self passKeyboardFocusTo: m]].
  			self error: 'Inconsistency in text editor'	"Must be somewhere in the successor chain"].
  	editor ifNil: 
  			["Reinstate selection after, eg, style change"
  			self installEditorToReplace: oldEditor].
+ 	self flag: #ImmPlugin.
  	"self setCompositionWindow."

More information about the Packages mailing list