[BUG] Code correction in PluggableTextMorph misaligned ( Solution suggestion attached )

frank at angband.za.org frank at angband.za.org
Sat Feb 28 17:52:20 UTC 2004


I started with a Workspace containing:

<quote>
Smalltalk garbageCollect
Smalltalk garbageCollect

BlobMorph allInstance
</quote>

I selected "BlobMorph allInstance" and hit printIt.

Parser>>correctSelector:wordIntervals:exprInterval:ifAbort: gets invoked
with a parameter spots (the wordIntervals parameter), an
OrderedCollection containing the Interval 11 to: 21 (the token
"allInstance"). This parameter gets passed to
Parser>>correctSelector:wordIntervals:.
But #correctSelector:wordIntervals: expects to replace strings in
requestor (the Workspace) at the intervals in its spots parameter. These
intervals need to be offset though, since we've selected text somewhere
in the middle of requestor.

This changeset introduces a new local variable, offsetSpots, to
Parser>>correctSelector:wordIntervals:exprInterval:ifAbort: which
contains the absolute offsets of the intervals needing replacement.

I've not checked for nasty side-effects introduced by this changeset. It
does seem to fix Ken's bug, but it needs experienced eyes to look at it.
Caveat executor!

frank
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FixCorrectSelector-fbs.cs.gz
Type: application/octet-stream
Size: 942 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20040228/a0b91e1b/FixCorrectSelector-fbs.cs.obj


More information about the Squeak-dev mailing list