The Trunk: Morphic-nice.307.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.307.mcz

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

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

Name: Morphic-nice.307
Author: nice
Time: 17 January 2010, 9:57:27.972 pm
UUID: 8f29688d-01a3-4313-b782-015845c88ac3
Ancestors: Morphic-ar.306

let handleEdit: answer the result of evaluating its block argument

=============== Diff against Morphic-ar.306 ===============

Item was changed:
  ----- Method: PluggableTextMorph>>handleEdit: (in category 'editor access') -----
  handleEdit: editBlock
  | result |
  textMorph editor selectFrom: selectionInterval first to: selectionInterval last;
  model: model.  "For, eg, evaluateSelection"
+ result := textMorph handleEdit: editBlock.   "Update selection after edit"
- textMorph handleEdit: [result := editBlock value].   "Update selection after edit"
  self scrollSelectionIntoView.
  ^ result!

Item was changed:
  ----- Method: TextMorph>>handleEdit: (in category 'editing') -----
  handleEdit: editBlock
  "Ensure that changed areas get suitably redrawn"
+ | result |
  self selectionChanged.  "Note old selection"
+ result := editBlock value.
- editBlock value.
  self selectionChanged.  "Note new selection"
+ self updateFromParagraph.  "Propagate changes as necessary"
+ ^result!
- self updateFromParagraph  "Propagate changes as necessary"!

Item was changed:
  ----- Method: PluggableTextMorph>>printIt (in category 'menu commands') -----
  printIt
  | result oldEditor |
 
  textMorph editor selectFrom: selectionInterval first to: selectionInterval last;
  model: model.  "For, eg, evaluateSelection"
+ result := textMorph handleEdit: [(oldEditor := textMorph editor) evaluateSelection].
- textMorph handleEdit: [result := (oldEditor := textMorph editor) evaluateSelection].
  ((result isKindOf: FakeClassPool) or: [result == #failedDoit]) ifTrue: [^self flash].
  selectionInterval := oldEditor selectionInterval.
  textMorph installEditorToReplace: oldEditor.
  textMorph handleEdit: [oldEditor afterSelectionInsertAndSelect: result printString].
  selectionInterval := oldEditor selectionInterval.
 
  textMorph editor selectFrom: selectionInterval first to: selectionInterval last.
  self scrollSelectionIntoView.
 
  !