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]]! |
Marcel, can you give an example where the #fixIntervalCache workaround in the former #printIt implementation is needed? :)
Best, Christoph Von: Squeak-dev <[hidden email]> im Auftrag von [hidden email] <[hidden email]>
Gesendet: Mittwoch, 22. Januar 2020 10:19:00 An: [hidden email] 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]]!
Carpe Squeak!
|
Free forum by Nabble | Edit this page |