<div dir="ltr"><div>Hi Marcel,</div><div>does if work for Character lf?</div><div>I know that we traditionally use Character cr in Squeak conventions, but we have made Text rendering work with polymorphic line-end a few years back.</div><div>So Character lf might occur here and there, even in source code without our notice.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le lun. 25 avr. 2022 à 11:19, <<a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Marcel Taeumel uploaded a new version of Morphic to project The Trunk:<br>
<a href="http://source.squeak.org/trunk/Morphic-mt.1970.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/trunk/Morphic-mt.1970.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Morphic-mt.1970<br>
Author: mt<br>
Time: 25 April 2022, 11:19:24.059234 am<br>
UUID: e5dd0f85-4aac-af44-a042-214fc331babf<br>
Ancestors: Morphic-mt.1969<br>
<br>
Fixes (older) regression where line breaks did not count as a boundary character, which made word-by-word jumping feel wrong.<br>
<br>
=============== Diff against Morphic-mt.1969 ===============<br>
<br>
Item was changed:<br>
----- Method: SmalltalkEditor>>nextWord: (in category 'private') -----<br>
nextWord: position <br>
| string index boundaryCharacters |<br>
string := self string.<br>
index := position - 1.<br>
[ (index<br>
between: 1<br>
and: string size) and: [ (string at: index) isSeparator ] ] whileTrue: [ index := index + 1 ].<br>
+ boundaryCharacters := ')]}''"|^. <br>
+ '.<br>
- boundaryCharacters := ')]}''"|^. '.<br>
((index<br>
between: 1<br>
and: string size) and: [ boundaryCharacters includes: (string at: index) ])<br>
ifTrue:<br>
[ index := index + 1 ]<br>
ifFalse:<br>
[ [ (index<br>
between: 1<br>
and: string size) and: [ (boundaryCharacters includes: (string at: index)) not ] ] whileTrue: [ index := index + 1 ] ].<br>
^ index!<br>
<br>
Item was changed:<br>
----- Method: SmalltalkEditor>>previousWord: (in category 'private') -----<br>
previousWord: position <br>
| string index boundaryCharacters |<br>
string := self string.<br>
index := position.<br>
"First, get out of whitespace."<br>
[ (index<br>
between: 2<br>
and: string size) and: [ (string at: index) isSeparator ] ] whileTrue: [ index := index - 1 ].<br>
+ boundaryCharacters := '([{''"|^. <br>
+ '.<br>
- boundaryCharacters := '([{''"|^. '.<br>
"Are we at a boundary character?"<br>
((index<br>
between: 2<br>
and: string size) and: [ boundaryCharacters includes: (string at: index) ])<br>
ifTrue:<br>
[ "yes, select it and any following whitespace of this line."<br>
index := index - 1 ]<br>
ifFalse:<br>
[ "no, select to the next boundary character"<br>
[ (index<br>
between: 1<br>
and: string size) and: [ (boundaryCharacters includes: (string at: index)) not ] ] whileTrue: [ index := index - 1 ] ].<br>
^ index + 1!<br>
<br>
<br>
</blockquote></div>