[squeak-dev] The Inbox: Morphic-ct.1619.mcz

Thiede, Christoph Christoph.Thiede at student.hpi.uni-potsdam.de
Wed Jan 22 09:20:25 UTC 2020


Marcel, can you give an example where the #fixIntervalCache workaround in the former #printIt implementation is needed? :)


Best,

Christoph

<http://www.hpi.de/>
________________________________
Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von commits at source.squeak.org <commits at source.squeak.org>
Gesendet: Mittwoch, 22. Januar 2020 10:19:00
An: squeak-dev at lists.squeakfoundation.org
Betreff: [squeak-dev] The Inbox: Morphic-ct.1619.mcz

Christoph Thiede uploaded a new version of Morphic to project The Inbox:
http://source.squeak.org/inbox/Morphic-ct.1619.mcz

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

Name: Morphic-ct.1619
Author: ct
Time: 22 January 2020, 10:18:49.982972 am
UUID: 7857d3bc-414b-cf4a-87bd-9d0aae05616f
Ancestors: Morphic-cmm.1618

Proposal: Unify all doIt related operations in PluggableTextMorph by delegating them to the editor.

This also fixes the fact that certain hooks such as #printIt:result:, #inspectIt:result:, or #exploreIt:result: were ignored when triggering the operation via the textmorph menu instead of shortcut. This is not an expected behavior, is it?

=============== Diff against Morphic-cmm.1618 ===============

Item was changed:
  ----- Method: PluggableTextMorph>>doIt (in category 'menu commands') -----
  doIt
+        ^ self handleEdit: [textMorph editor doIt]!
-        ^self handleEdit: [textMorph editor evaluateSelection]!

Item was changed:
  ----- Method: PluggableTextMorph>>exploreIt (in category 'menu commands') -----
  exploreIt
+        ^ self handleEdit: [textMorph editor exploreIt]!
-
-
-        self handleEdit:
-                [textMorph editor evaluateSelectionAndDo: [:result | result explore]].!

Item was changed:
  ----- Method: PluggableTextMorph>>inspectIt (in category 'menu commands') -----
  inspectIt
+        ^ self handleEdit: [textMorph editor inspectIt]!
-
-        self handleEdit:
-                [textMorph editor evaluateSelectionAndDo: [:result | result inspect]]!

Item was changed:
  ----- Method: PluggableTextMorph>>printIt (in category 'menu commands') -----
  printIt
+        ^ self handleEdit: [textMorph editor printIt]!
-        | oldEditor |
-        textMorph editor selectFrom: selectionInterval first to: selectionInterval last;
-                                                model: model.  "For, eg, evaluateSelection"
-        textMorph handleEdit: [(oldEditor := textMorph editor) evaluateSelectionAndDo:
-                [:result |
-                self flag: #fixIntervalCache. "mt: We should find a better design for discarding unused text editors in text morphs and restoring them on demand."
-                selectionInterval := oldEditor markIndex to: oldEditor pointIndex -1.
-                textMorph installEditorToReplace: oldEditor.
-                textMorph handleEdit: [oldEditor afterSelectionInsertAndSelect: result printString].
-                selectionInterval := oldEditor markIndex to: oldEditor pointIndex -1.
-
-                textMorph editor selectFrom: selectionInterval first to: selectionInterval last.
-                self scrollSelectionIntoView]]!


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200122/f2e5d3ea/attachment.html>


More information about the Squeak-dev mailing list