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

Thiede, Christoph Christoph.Thiede at student.hpi.uni-potsdam.de
Thu Nov 14 11:58:13 UTC 2019


Hi Marcel,


yes, <cmd>0 still works. It is an interesting idea to put the link aside to the actual print string, but I have to admit that both approaches would make the usual workflow of copying and reusing the printIt string more complicated, unfortunately ...


Another idea, should we maybe consider some kind of TextMorph/editor extension that is indeed not affected by clipboard? Visually, something like:


[cid:c4954e41-9206-4223-ab5e-ea0d86e2d30e]


Such a text attachment would need to be laid out like regular TextAnchors, however, they must not be selected by the cursor. One could describe the idea as an extension to the TextAnchor that prohibits an editor to select it.


***


BTW: Another related problem is that unless you delete the printed-it string, all following commands in a workspace will be miss-styled (see above). Someone recently mentioned that Pharo restarts styling after #codeExcess in each new line, which sounds great. Should we maybe add a similar feature to Shout?


Best,

Christoph

________________________________
Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von Taeumel, Marcel
Gesendet: Donnerstag, 14. November 2019 09:28:58
An: John Pfersich via Squeak-dev
Betreff: Re: [squeak-dev] The Inbox: Morphic-ct.1586.mcz

> ... spread all over your workspace ...

What do you mean by that? Copy-and-paste of text should always carry those attributes. With "spreading" I thought you mean you would unintentionally extend those text links to other characters.

What about this style after a print-it :

World extent 3840 at 2004 [explore]

Tricky. We want to preserve to preserve the actual #printString ... Does [cmd]+[0] still work?

Best,
Marcel

Am 13.11.2019 18:06:48 schrieb Thiede, Christoph <christoph.thiede at student.hpi.uni-potsdam.de>:

Hi Marcel,


Thanks for the hint, I played a bit around with emphasisHere. But if I am not mistaken, you cannot set emphasisHere for the next character to be typed while another text (the printIt result) is currently selected?


This is also only one half of the problem. Personally, I often copy one printIt result to use it at another place. (I know, variables would be a better option, however, I feel convenient to do this.) It looks kind of weird if this link is spread all over your workspace:


[cid:1a56dcc7-b8be-4dd1-81fa-4e9983c966f8]

So unless someone has a great idea to avoid this (a special RunArray of attributes that are private to an editor? a TextAttribute that cannot be copied?), I would rather tend to withdraw my proposal ...


(Btw: A somehow related issue is that the search bar accepts formatted text from clipboard but does not style it, so in my image, it often looks kind of missstyled:

[cid:ddfbae54-9593-4ea1-aec1-7e552acbd8be])


Best,

Christoph

________________________________
Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von Taeumel, Marcel
Gesendet: Dienstag, 12. November 2019 14:05:23
An: John Pfersich via Squeak-dev
Betreff: Re: [squeak-dev] The Inbox: Morphic-ct.1586.mcz

Is it because you do not append "emphasisHere" after your custom emphasis?

Am 12.11.2019 13:15:43 schrieb Thiede, Christoph <christoph.thiede at student.hpi.uni-potsdam.de>:

Only drawback: If you copy the result to use it for another computation, you spread the link formatting all over your code ...

________________________________
Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von Taeumel, Marcel
Gesendet: Dienstag, 12. November 2019 10:36:07
An: John Pfersich via Squeak-dev
Betreff: Re: [squeak-dev] The Inbox: Morphic-ct.1586.mcz

+1

Best,
Marcel

Am 10.11.2019 16:07:23 schrieb Thiede, Christoph <christoph.thiede at student.hpi.uni-potsdam.de>:

[cid:23717c7d-e38c-4ef9-b852-51c42943885d]

________________________________
Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von commits at source.squeak.org <commits at source.squeak.org>
Gesendet: Sonntag, 10. November 2019 16:06:26
An: squeak-dev at lists.squeakfoundation.org
Betreff: [squeak-dev] The Inbox: Morphic-ct.1586.mcz

A new version of Morphic was added to project The Inbox:
http://source.squeak.org/inbox/Morphic-ct.1586.mcz

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

Name: Morphic-ct.1586
Author: ct
Time: 10 November 2019, 4:06:17.228559 pm
UUID: d752eb23-2116-0945-b043-aff08fed94fd
Ancestors: Morphic-mt.1584

Proposal: Style printIt results as a pluggable link that can be clicked to inspect the result.

To enable this behavior, this commit also extends #insertAndSelect:at: to allow for inserting both strings and texts.

=============== Diff against Morphic-mt.1584 ===============

Item was changed:
  ----- Method: PluggableTextMorph>>printIt (in category 'menu commands') -----
  printIt
         | oldEditor |
         textMorph editor selectFrom: selectionInterval first to: selectionInterval last;
                                                 model: model.  "For, eg, evaluateSelection"
         textMorph handleEdit: [(oldEditor := textMorph editor) evaluateSelectionAndDo:
                 [:result |
                 selectionInterval := oldEditor selectionInterval.
                 textMorph installEditorToReplace: oldEditor.
+                textMorph handleEdit: [ oldEditor afterSelectionInsertAndSelect:
+                        (oldEditor printTextFor: result)].
-                textMorph handleEdit: [oldEditor afterSelectionInsertAndSelect: result printString].
                 selectionInterval := oldEditor selectionInterval.

                 textMorph editor selectFrom: selectionInterval first to: selectionInterval last.
                 self scrollSelectionIntoView]]!

Item was changed:
  ----- Method: TextEditor>>afterSelectionInsertAndSelect: (in category 'new selection') -----
+ afterSelectionInsertAndSelect: aStringOrText
- afterSelectionInsertAndSelect: aString

+        self insertAndSelect: aStringOrText at: self stopIndex !
-        self insertAndSelect: aString at: self stopIndex !

Item was changed:
  ----- Method: TextEditor>>insertAndSelect:at: (in category 'new selection') -----
+ insertAndSelect: aStringOrText at: anInteger
- insertAndSelect: aString at: anInteger

+        aStringOrText isString ifTrue: [
+                ^ self
+                        insertAndSelect: (Text string: aStringOrText attributes: emphasisHere)
+                        at: anInteger].
-        self closeTypeIn.

+        self closeTypeIn.
         self selectInvisiblyFrom: anInteger to: anInteger - 1.
         self openTypeIn.

         self
                 replace: self selectionInterval
+                with: (Text string: ' ' attributes: emphasisHere), aStringOrText
-                with: (Text string: (' ', aString) attributes: emphasisHere)
                 and: [].
-
         self closeTypeIn.!

Item was changed:
  ----- Method: TextEditor>>printIt (in category 'do-its') -----
  printIt

         self evaluateSelectionAndDo: [:result |
                 (model respondsTo: #printIt:result:)
                         ifTrue: [model
                                 perform: #printIt:result:
                                 with: self selection
                                 with: result]
+                        ifFalse: [self afterSelectionInsertAndSelect: (self printTextFor: result)]]!
-                        ifFalse: [self afterSelectionInsertAndSelect: result printString]]!

Item was added:
+ ----- Method: TextEditor>>printTextFor: (in category 'do-its') -----
+ printTextFor: anObject
+
+        ^ Text
+                string: anObject printString
+                attributes: {PluggableTextAttribute evalBlock: [anObject inspect]}!


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20191114/4a923ad4/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pastedImage.png
Type: image/png
Size: 33002 bytes
Desc: pastedImage.png
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20191114/4a923ad4/attachment.png>


More information about the Squeak-dev mailing list