[squeak-dev] The Trunk: Morphic-mt.1974.mcz

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Wed Apr 27 19:22:54 UTC 2022


Ah, is it robust to future editions?
Not that I would recommend it, but here is a very ugly trick that still
works in trunk:
    'abc' , #[13 10]
More reasonably, I think that we can afford this small concatenation
    'abc' , String crlf

Le mer. 27 avr. 2022 à 16:57, <commits at source.squeak.org> a écrit :

> Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
> http://source.squeak.org/trunk/Morphic-mt.1974.mcz
>
> ==================== Summary ====================
>
> Name: Morphic-mt.1974
> Author: mt
> Time: 27 April 2022, 4:57:27.371228 pm
> UUID: bbf92ccb-7fe1-7f4b-9ab6-955f0f2ba601
> Ancestors: Morphic-mt.1973
>
> For by-word jumping in text fields, adds LF to the literal array of
> boundary characters.
>
> Thanks to Nicolas (nice) for the hint!
>
> =============== Diff against Morphic-mt.1973 ===============
>
> Item was changed:
>   ----- Method: SmalltalkEditor>>nextWord: (in category 'private') -----
>   nextWord: position
>         | string index boundaryCharacters |
>         string := self string.
>         index := position - 1.
>         [ (index
>                 between: 1
>                 and: string size) and: [ (string at: index) isSeparator ]
> ] whileTrue: [ index := index + 1 ].
>         boundaryCharacters := ')]}''"|^.
>   '.
> +
>         ((index
>                 between: 1
>                 and: string size) and: [ boundaryCharacters includes:
> (string at: index) ])
>                 ifTrue:
>                         [  index := index + 1  ]
>                 ifFalse:
>                         [ [ (index
>                                 between: 1
>                                 and: string size) and: [
> (boundaryCharacters includes: (string at: index)) not ] ] whileTrue: [
> index := index + 1 ] ].
>         ^ index!
>
> Item was changed:
>   ----- Method: SmalltalkEditor>>previousWord: (in category 'private')
> -----
>   previousWord: position
>         | string index boundaryCharacters |
>         string := self string.
>         index := position.
>         "First, get out of whitespace."
>         [ (index
>                 between: 2
>                 and: string size) and: [ (string at: index) isSeparator ]
> ] whileTrue: [ index := index - 1 ].
>         boundaryCharacters := '([{''"|^.
>   '.
> +
>         "Are we at a boundary character?"
>         ((index
>                 between: 2
>                 and: string size) and: [ boundaryCharacters includes:
> (string at: index) ])
>                 ifTrue:
>                         [ "yes, select it and any following whitespace of
> this line."
>                         index := index - 1 ]
>                 ifFalse:
>                         [ "no, select to the next boundary character"
>                         [ (index
>                                 between: 1
>                                 and: string size) and: [
> (boundaryCharacters includes: (string at: index)) not ] ] whileTrue: [
> index := index - 1 ] ].
>         ^ index + 1!
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220427/7100a43f/attachment-0001.html>


More information about the Squeak-dev mailing list