[squeak-dev] Merge Request: decoupleShout.1.cs

christoph.thiede at student.hpi.uni-potsdam.de christoph.thiede at student.hpi.uni-potsdam.de
Tue Nov 2 15:08:19 UTC 2021


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

Change Set:        decoupleShout
Date:            2 November 2021
Author:            Christoph Thiede

This changeset complements the refactoring from System-mt.1240 intended to decouple the base system from Shout. In various places, there were still hard-coded references to SHTextStylerST80 that did not use the new TextStyler abstraction. These accesses are redirected correctly with this changeset. Furthermore, the TextStyler interface is updated to not automatically set a styler if it has been set to nil manually. This makes it possible to opt-out to styling via ShoutCore-ct.88.

=============== Diff ===============

PBClassPreferenceView>>initialize {initialize-release} · ct 11/1/2021 23:25 (changed)
initialize
    super initialize.
-     styler := (Smalltalk classNamed: 'SHTextStylerST80') ifNotNil: [:s | s new].
-     completionController := (Smalltalk classNamed: 'OController') ifNotNil: [:oc | oc model: self].
+     styler := (TextStyler for: #Smalltalk) ifNotNil: [:s | s new].
+     completionController := (Smalltalk classNamed: #OController) ifNotNil: [:oc | oc model: self].

PluggableCodePaneSpec>>stylerClass {accessing} · ct 11/1/2021 23:21 (changed)
stylerClass

-     ^ super stylerClass ifNil: [Smalltalk classNamed: 'SHTextStylerST80']
+     ^ super stylerClass ifNil: [TextStyler for: #Smalltalk]

SmalltalkEditor>>styleSelection {do-its} · ct 11/1/2021 23:30 (changed)
styleSelection

    | styler |
    self lineSelectAndEmptyCheck: [^ ''].
-     styler := self styler ifNil: [(TextStyler for: #Smalltalk) new].
+     styler := self styler ifNil: [(TextStyler for: #Smalltalk) ifNotNil: [:c | c new]].
    ^ styler styledTextFor: self selection

TextStyler class>>defaultFor: {accessing} · ct 11/1/2021 23:30 (changed)
defaultFor: syntax

-     ^ default
-         at: syntax
-         ifAbsent: [self askForDefaultFor: syntax]
+     ^ self defaultOrNilFor: syntax


---
Sent from Squeak Inbox Talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20211102/e5bc2afc/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: decoupleShout.1.cs
Type: application/octet-stream
Size: 1906 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20211102/e5bc2afc/attachment.obj>


More information about the Squeak-dev mailing list