<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<p>Hi Marcel,</p>
<p><br>
</p>
<p>I got it :) If it is not ok to style, #updateStyle will periodically reset all attributes possibly relating to Shout. One option would be to remove these styles once in Workspace>>#toggleStyling:. Or we could introduce a state variable for this purpose in
 PluggableTextMorphPlus itself.</p>
<p><br>
</p>
<p>Another approach: M<span>aybe I misunderstood Tim Rowledge, but would it be an option to introduce an additional TextAttribute that assigns substrings to Shout? Such a TextSyntaxHighlight style would complement the effect of <span style="font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size:16px">Morphic-mt.1498,
 but also allow you, for example, to format a code example in a class comment without hard-coding the current ui theme & environment. In Workspace, #toggleStyling then could add or remove such an attribute from the whole text.</span></span></p>
<p><span><span style="font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size:16px"><br>
</span></span></p>
<p><span><span style="font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size:16px">One open question would be where to store the styling information? But
 I think it could be left in the styler instance, so <span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;">TextSyntaxHighlight
 would only specify that something should be styled, but #aboutToStyle: was responsible for specifying the contextual information.</span></span></span></p>
<p><br>
</p>
<p>Best,</p>
<p>Christoph</p>
<div id="Signature">
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<br>
<div><font size="2" color="#808080"></font></div>
</div>
</div>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von Taeumel, Marcel<br>
<b>Gesendet:</b> Mittwoch, 7. August 2019 09:38:53<br>
<b>An:</b> John Pfersich via Squeak-dev; squeak-dev@mail.squeak.org<br>
<b>Betreff:</b> Re: [squeak-dev] The Inbox: ToolBuilder-Morphic-ct.234.mcz</font>
<div> </div>
</div>
<div>
<div id="__MailbirdStyleContent" style="font-size:10pt; font-family:Arial; color:#000000">
<div>Hi Christoph, </div>
<div><br>
</div>
- open a workspace
<div>- type something</div>
<div>- select something</div>
<div>- hit CMD+6 or 7 or 8 to style something</div>
<div><br>
</div>
<div>That must work. :-)</div>
<div><br>
</div>
<div>Best,</div>
<div>Marcel</div>
<div class="mb_sig"></div>
<blockquote class="history_container" type="cite" style="border-left-style:solid; border-width:1px; margin-top:20px; margin-left:0px; padding-left:10px">
<p style="color:#AAAAAA; margin-top:10px">Am 07.08.2019 09:33:55 schrieb Thiede, Christoph <christoph.thiede@student.hpi.uni-potsdam.de>:</p>
<div style="font-family:Arial,Helvetica,sans-serif">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<p>Hi,</p>
<p><br>
</p>
<p>what exactly "doesn't do" it? Toggling styling and keeping custom stylings in Workspace by using the version from your screenshot worked for me.</p>
<p><br>
</p>
<p>#unstyledTextFrom: - are there any tests for this behavior? Should we change the implementation in the Inbox?</p>
<p><br>
</p>
<p>Best,</p>
<p>Christoph</p>
<div id="Signature">
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div><span style="font-size:10pt; color:#808080"></span></div>
<div><span style="font-size:10pt; color:#808080"><br>
</span></div>
</div>
</div>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><span style="font-family:Calibri,sans-serif; color:#000000"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von Taeumel, Marcel<br>
<b>Gesendet:</b> Dienstag, 6. August 2019 16:00:37<br>
<b>An:</b> John Pfersich via Squeak-dev<br>
<b>Betreff:</b> Re: [squeak-dev] The Inbox: ToolBuilder-Morphic-ct.234.mcz</span>
<div> </div>
</div>
<div>
<div id="__MailbirdStyleContent" style="font-size:10pt; font-family:Arial; color:#000000">
Hi, there.
<div><br>
</div>
<div>There has to be a way to allow manual styling in workspaces. This doesn't do it:</div>
<div><br>
</div>
<div><img width="auto" style="user-select: none;" src="cid:1404af3b-7074-4941-a6a3-25cb08aeb95e"></div>
<div><br>
</div>
<div>Yeah, I have no idea, why #unstyledTextFrom: keeps so many attributes. Has been this way like forever:</div>
<div><br>
</div>
<div><img width="auto" style="user-select: none;" src="cid:39c362b7-1cf4-4782-bed1-1e58e6487250"></div>
<div><br>
</div>
<div>Best,</div>
<div>Marcel</div>
<div class="mb_sig"></div>
<blockquote class="history_container" type="cite" style="border-left-style:solid; border-width:1px; margin-top:20px; margin-left:0px; padding-left:10px; min-width:500px">
<p style="color:#AAAAAA; margin-top:10px">Am 06.08.2019 14:41:19 schrieb Thiede, Christoph <christoph.thiede@student.hpi.uni-potsdam.de>:</p>
<div style="font-family:Arial,Helvetica,sans-serif">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<p>Hi Marcel,</p>
<p><br>
</p>
<p>ok, I assumed #updateStyle would be only sent if styling is active, but I was wrong. I knew this handy styling shortcut before, and just found out that your proposed condition maybe would not be sufficient: As Shout preserves some styles (for example TextDoIts),
 it would be a pity to delete them when you disable syntax highlighting in Workspace. This is also what happens in Squeak-5.2<span style="font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size:16px">,
 so I would like to keep </span><span style="font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size:16px">Tools-ct.867</span>.</p>
<p><br>
</p>
<p>Just one proposal to solve this:<span></span></p>
<p><br>
</p>
<p></p>
<div>updateStyleNow</div>
<div><br>
</div>
<div><span style="white-space:pre"></span>styler ifNil: [^ self].</div>
<div><span style="white-space:pre"></span>self okToStyle</div>
<div><span style="white-space:pre"></span>ifTrue: [styler style: textMorph contents]</div>
<div><span style="white-space:pre"></span>ifFalse: [textMorph contents: (styler unstyledTextFrom: textMorph contents)].</div>
<div><br>
</div>
<div>(#updateStyle analogously)</div>
<div><br>
</div>
<div>This preserves custom stylings when you toggle styling in Workspace.</div>
<div><br>
</div>
<div>---</div>
<div><br>
</div>
<div>It still does not work perfect, I think there are kept too many attributes after toggling styling off:</div>
<div><br>
</div>
<div><img size="4062" id="img433030" tabindex="0" style="max-width: 99.9%; user-select: none;" src="cid:982db5da-e636-4aeb-914b-eeabd309f122"></div>
<div>(custom attributes: one TextDoIt, one TextURL)</div>
<div>becomes to</div>
<div><img size="4084" id="img415642" tabindex="0" style="max-width: 99.9%; user-select: none;" src="cid:5788ce00-d4fb-40e4-bc6d-01ca7c2f88e7"><br>
</div>
<div><br>
</div>
<div>I wonder why #unstyledTextFrom: handles all attributes on this binary way? I changed it</div>
<div><br>
</div>
<div>
<div>unstyledTextFrom: aText</div>
<div><span style="white-space:pre"></span>"Re-implemented so that TextActions are not removed from aText"</div>
<div><span style="white-space:pre"></span>| answer |<span style="white-space:pre">
</span></div>
<div><span style="white-space:pre"></span>answer := super unstyledTextFrom: aText.</div>
<div><span style="white-space:pre"></span>aText runs withStartStopAndValueDo: [:start :stop :attribs |</div>
<div>+<span style="white-space:pre"> </span>attribs</div>
<div>+<span style="white-space:pre"> </span>select: [:each | each shoutShouldPreserve]</div>
<div>+<span style="white-space:pre"> </span>thenDo: [:each | answer addAttribute: each from: start to: stop]].</div>
<div>-<span style="white-space:pre"> </span>(attribs anySatisfy: [:each | each shoutShouldPreserve])</div>
<div>-<span style="white-space:pre"> </span>ifTrue: [</div>
<div>-<span style="white-space:pre"> </span>attribs do: [:eachAttrib | answer addAttribute: eachAttrib from: start to: stop]]].</div>
<div><span style="white-space:pre"></span>^answer</div>
</div>
<div><br>
</div>
<div>and it looks like this:</div>
<div><br>
</div>
<div><img size="5123" id="img195432" tabindex="0" style="max-width: 99.9%; user-select: none;" src="cid:acb3ae0a-e2e1-42a7-8f3c-a5dc5bbddb2d"><br>
</div>
<div><br>
</div>
<div>Are there any reasons for the current implementation of #unstyledTextFrom:? Looking forward to your opinions :)</div>
<div><br>
</div>
<div>Best,</div>
<div>Christoph</div>
<p></p>
<div id="Signature">
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
</div>
</div>
</div>
<div id="divRplyFwdMsg" dir="ltr"><span style="font-family:Calibri,sans-serif; color:#000000"><b><br>
</b></span></div>
<div id="divRplyFwdMsg" dir="ltr"><span style="font-family:Calibri,sans-serif; color:#000000"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von Taeumel, Marcel<br>
<b>Gesendet:</b> Dienstag, 6. August 2019 09:22:37<br>
<b>An:</b> John Pfersich via Squeak-dev<br>
<b>Betreff:</b> Re: [squeak-dev] The Inbox: ToolBuilder-Morphic-ct.234.mcz</span>
<div> </div>
</div>
<div>
<div id="__MailbirdStyleContent" style="font-size:10pt; font-family:Arial; color:#000000">
Hi Christoph,
<div><br>
</div>
<div>this is not working. We have to support manual styling and cannot just remove text attributes there. Maybe if we check whether "styer" is set. Even then, we should follow the logic in PluggableTextMorphPlus >> #stylerStyled: to remove those text attributes.</div>
<div><br>
</div>
<div>Btw: You can style a piece of text manually via the context menu or [CMD]+[6..0].</div>
<div><br>
</div>
<div>Best,</div>
<div>Marcel</div>
<div class="mb_sig"></div>
<blockquote class="history_container" type="cite" style="border-left-style:solid; border-width:1px; margin-top:20px; margin-left:0px; padding-left:10px; min-width:500px">
<p style="color:#AAAAAA; margin-top:10px">Am 05.08.2019 14:50:20 schrieb commits@source.squeak.org <commits@source.squeak.org>:</p>
<div style="font-family:Arial,Helvetica,sans-serif">A new version of ToolBuilder-Morphic was added to project The Inbox:<br>
http://source.squeak.org/inbox/ToolBuilder-Morphic-ct.234.mcz<br>
<br>
==================== Summary ====================<br>
<br>
Name: ToolBuilder-Morphic-ct.234<br>
Author: ct<br>
Time: 5 August 2019, 2:50:11.900062 pm<br>
UUID: f6987fae-9cfa-4e44-927f-247f4eeb868e<br>
Ancestors: ToolBuilder-Morphic-mt.233<br>
<br>
Extend #updateStyle(Now) to remove obsolete styling<br>
<br>
A call of #updateStyle(Now) implies that the text morph is used for styling, so it is not capable of storing other styles we could accidentally delete here.<br>
<br>
=============== Diff against ToolBuilder-Morphic-mt.233 ===============<br>
<br>
Item was changed:<br>
----- Method: PluggableTextMorphPlus>>updateStyle (in category 'styling') -----<br>
updateStyle<br>
<br>
self okToStyle<br>
+ ifTrue: [styler styleInBackgroundProcess: textMorph contents]<br>
+ ifFalse: [textMorph contents: textMorph contents asString].!<br>
- ifTrue: [styler styleInBackgroundProcess: textMorph contents].!<br>
<br>
Item was changed:<br>
----- Method: PluggableTextMorphPlus>>updateStyleNow (in category 'styling') -----<br>
updateStyleNow<br>
<br>
self okToStyle<br>
+ ifTrue: [styler style: textMorph contents]<br>
+ ifFalse: [textMorph contents: textMorph contents asString].!<br>
- ifTrue: [styler style: textMorph contents].!<br>
<br>
<br>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</body>
</html>