The Trunk: Morphic-nice.611.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Morphic-nice.611.mcz

commits-2
Nicolas Cellier uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-nice.611.mcz

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

Name: Morphic-nice.611
Author: nice
Time: 22 February 2012, 2:57:33.901 am
UUID: 090dee16-7401-427a-8e8f-c40c375793a1
Ancestors: Morphic-cmm.610

Avoid the compiler notification offset to be doubled when evaluating a sub-selection in a TextEditor.

Notes:

In Squeak, the notification offset is already taken into account in the source Stream because of
TextEditor>>selectionAsStream
        "Answer a ReadStream on the text in the paragraph that is currently  selected."
        ^ReadWriteStream
                on: paragraph string
                from: self startIndex
                to: self stopIndex - 1

So it is not necessary to add the self startIndex offset one more time in TextEditor>>notify:at:in:

This might differ from Cuis solution.

=============== Diff against Morphic-cmm.610 ===============

Item was changed:
  ----- Method: TextEditor>>notify:at:in: (in category 'new selection') -----
  notify: aString at: anInteger in: aStream
  "The compilation of text failed. The syntax error is noted as the argument,
  aString. Insert it in the text at starting character position anInteger."
 
+ self insertAndSelect: aString at: (anInteger max: 1)!
- | pos |
- pos := self selectionInterval notEmpty
- ifTrue: [
- self startIndex + anInteger - 1 ]
- ifFalse: [anInteger].
- self insertAndSelect: aString at: (pos max: 1)!