The Trunk: Morphic-nice.1657.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Morphic-nice.1657.mcz

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

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

Name: Morphic-nice.1657
Author: nice
Time: 8 May 2020, 6:45:14.165388 pm
UUID: 3ad63913-040d-4558-a021-19cb1240eb37
Ancestors: Morphic-nice.1656

Provide #selectIntervalInvisibly: for the interactive correction from the Parser.

See ST80-nice.254.

This replace the sends to select and deselect which should now (or in a very near future) be gone. Nuke'em all!

TextEditor: also avoid sending deselect to ourself now that we know that it will do nothing.

=============== Diff against Morphic-nice.1656 ===============

Item was removed:
- ----- Method: Editor>>deselect (in category 'current selection') -----
- deselect
- "Compatibility stub with st80"
- !

Item was added:
+ ----- Method: Editor>>selectIntervalInvisibly: (in category 'new selection') -----
+ selectIntervalInvisibly: anInterval
+ "Deselect, then select the specified characters inclusive.
+ Do not yet make the new selection visible."
+
+ self selectInvisiblyFrom: anInterval first to: anInterval last!

Item was removed:
- ----- Method: PluggableTextMorph>>deselect (in category 'interactive error protocol') -----
- deselect
- ^ textMorph editor deselect!

Item was removed:
- ----- Method: PluggableTextMorph>>select (in category 'interactive error protocol') -----
- select
- ^ textMorph editor select!

Item was added:
+ ----- Method: PluggableTextMorph>>selectIntervalInvisibly: (in category 'interactive error protocol') -----
+ selectIntervalInvisibly: aSelectionInterval
+ ^ textMorph editor selectIntervalInvisibly: aSelectionInterval!

Item was removed:
- ----- Method: SmalltalkEditor>>select (in category 'compatibility') -----
- select
- "Sent by the parser when correcting variables etc. Ignored here."!

Item was changed:
  ----- Method: TextEditor>>keyStroke: (in category 'events') -----
  keyStroke: anEvent
+   self resetTypeAhead.
-   self resetTypeAhead; deselect.
 
  (self dispatchOnKeyboardEvent: anEvent)
  ifTrue: [
  self closeTypeIn.
  self storeSelectionInParagraph.
  ^self].
 
  self openTypeIn.
  self
  zapSelectionWith: self typeAhead contents;
  resetTypeAhead;
  unselect;
  storeSelectionInParagraph.!

Item was changed:
  ----- Method: TextEditor>>prettyPrint: (in category 'menu messages') -----
  prettyPrint: decorated
  "Reformat the contents of the receiver's view (a Browser or Workspace)."
 
  model selectedClassOrMetaClass
  ifNil: [ "arbitrary text selection in a workspace, not directly associated with a class"
  (Compiler new formatNoPattern: self selection environment: model environment)
  ifNotNilDo: [:newText | self replaceSelectionWith: newText]]
  ifNotNil: [:selectedClass | "source for a method in the selected class"
  (selectedClass newCompiler
  format: self text
  in: selectedClass
  notifying: self
  decorated: decorated)
  ifNotNilDo: [ :newText |
+ self selectInvisiblyFrom: 1 to: paragraph text size.
- self deselect; selectInvisiblyFrom: 1 to: paragraph text size.
  self replaceSelectionWith: (selectedClass ifNil: [newText] ifNotNil: [newText asText makeSelectorBoldIn: selectedClass]).
  self selectAt: self text size + 1 ]].
  !

Item was changed:
  ----- Method: TextEditor>>zapSelectionWith: (in category 'mvc compatibility') -----
  zapSelectionWith: replacement
 
  | start stop rep |
  morph readOnly ifTrue: [^ self].
- self deselect.
  start := self startIndex.
  stop := self stopIndex.
  (replacement isEmpty and: [stop > start]) ifTrue: [
  "If deleting, then set emphasisHere from 1st character of the deletion"
  emphasisHere := (self text attributesAt: start) select: [:att | att mayBeExtended]].
  (start = stop and: [ replacement isEmpty ]) ifFalse: [
  replacement isText
  ifTrue: [ rep := replacement]
  ifFalse: [ rep := Text string: replacement attributes: emphasisHere ].
  self text replaceFrom: start to: stop - 1 with: rep.
  paragraph
  recomposeFrom: start
  to:  start + rep size - 1
  delta: rep size - (stop-start).
  self markIndex: start pointIndex: start + rep size.
  otherInterval := self selectionInterval].
 
  self userHasEdited  " -- note text now dirty"!