[squeak-dev] The Trunk: Morphic-nice.1656.mcz

commits at source.squeak.org commits at source.squeak.org
Fri May 8 15:05:28 UTC 2020


Nicolas Cellier uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-nice.1656.mcz

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

Name: Morphic-nice.1656
Author: nice
Time: 8 May 2020, 5:03:44.586886 pm
UUID: 4550059e-1a22-4ef8-9476-af4aadbcee48
Ancestors: Morphic-mt.1655

Nuke selectionShowing, it's never true.
Thus nuke reverseSelection, it's never sent.

If selectionShowing were true, then we would send #reverseFrom:to: to NewParagraph, and NewParagraph would bark because such message is not understood, it's food for st-80 Paragraph, not for Morphic.

Keep deselect (as we kept select two levels down in SmalltalkEditor) because it's still used by the Parser for st80 compatibility. IMO, the Parser should better mind its own business, and let the Editor handle that responsibility (ParagraphEditor, if you hear me...).

In one of my image, the selection stopped showing in Debugger, and that is ultra upsetting. While tracking the cause, obsolete unused stuff like this is hurdles put on your way just for pleasure to see how well you jump. Not so well if you wanna know...

=============== Diff against Morphic-mt.1655 ===============

Item was changed:
  Object subclass: #Editor
+ 	instanceVariableNames: 'morph'
- 	instanceVariableNames: 'morph selectionShowing'
  	classVariableNames: 'BlinkingCursor DestructiveBackWord DumbbellCursor KeystrokeActions SelectionsMayShrink'
  	poolDictionaries: ''
  	category: 'Morphic-Text Support'!
  
  !Editor commentStamp: 'hjh 9/28/2017 11:37' prior: 0!
  New text editors.
  TextEditor provides most of the functionality that used to be in TextMorphEditor.
  SmalltalkEditor is has Smalltalk code specific features.
  !

Item was changed:
  ----- Method: Editor>>deselect (in category 'current selection') -----
  deselect
+ 	"Compatibility stub with st80"
+ !
- 	"If the text selection is visible on the screen, reverse its highlight."
- 
- 	selectionShowing ifTrue: [self reverseSelection]!

Item was changed:
  ----- Method: TextEditor>>correctFrom:to:with: (in category 'new selection') -----
  correctFrom: start to: stop with: aString
  	"Make a correction in the model that the user has authorised from somewhere else in the system (such as from the compilier).  The user's selection is not changed, only corrected."
+ 	| userSelection delta loc |
- 	| userSelection delta loc wasShowing |
  	aString = '#insert period' ifTrue: [
  		loc := start.
  		[(loc := loc-1)>0 and: [(paragraph string at: loc) isSeparator]]
  			whileTrue: [loc := loc-1].
  		^ self correctFrom: loc+1 to: loc with: '.'].
- 	(wasShowing := selectionShowing) ifTrue: [ self reverseSelection ].
  	userSelection := self selectionInterval.
  
  	self selectInvisiblyFrom: start to: stop.
  	self replaceSelectionWith: aString.
  
  	delta := aString size - (stop - start + 1).
  	self
  		selectInvisiblyFrom: userSelection first + (userSelection first > start ifFalse: [ 0 ] ifTrue: [ delta ])
+ 		to: userSelection last + (userSelection last > start ifFalse: [ 0 ] ifTrue: [ delta ]).!
- 		to: userSelection last + (userSelection last > start ifFalse: [ 0 ] ifTrue: [ delta ]).
- 	wasShowing ifTrue: [ self reverseSelection ].
- !

Item was changed:
  ----- Method: TextEditor>>resetState (in category 'initialize-release') -----
  resetState 
  	"Establish the initial conditions for editing the paragraph: place caret 
  	before first character, set the emphasis to that of the first character,
  	and save the paragraph for purposes of canceling."
  
  	pointBlock := markBlock := paragraph defaultCharacterBlock.
  	beginTypeInIndex := nil.
  	otherInterval := 1 to: 0.
+ 	self setEmphasisHere.!
- 	self setEmphasisHere.
- 	selectionShowing := false!

Item was removed:
- ----- Method: TextEditor>>reverseSelection (in category 'current selection') -----
- reverseSelection
- 	"Reverse the valence of the current selection highlighting."
- 	selectionShowing := selectionShowing not.
- 	paragraph reverseFrom: pointBlock to: markBlock!



More information about the Squeak-dev mailing list