[squeak-dev] The Trunk: Morphic-ul.314.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Feb 1 01:18:08 UTC 2010

Levente Uzonyi uploaded a new version of Morphic to project The Trunk:

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

Name: Morphic-ul.314
Author: ul
Time: 1 February 2010, 1:50:15.396 am
UUID: 2b034a41-c53e-f44b-9da4-2b2a4f454798
Ancestors: Morphic-dtl.313

- fix: http://bugs.squeak.org/view.php?id=7449

Implement TextEditor >> #selectionAsStream just like ParagraphEditor >> #selectionAsStream. The system expects that the stream contains the full text of the editor, but only the selection can be read from it.

- fix: SmalltalkEditor >> #tallyIt

=============== Diff against Morphic-dtl.313 ===============

Item was changed:
  ----- Method: TextEditor>>selectionAsStream (in category 'accessing-selection') -----
  	"Answer a ReadStream on the text in the paragraph that is currently 
+ 	^ReadWriteStream
+ 		on: paragraph string
+ 		from: self startIndex
+ 		to: self stopIndex - 1!
- 	^ReadStream
- 		on: (paragraph string copyFrom: self startIndex to: self stopIndex - 1)!

Item was changed:
  ----- Method: SmalltalkEditor>>tallySelection (in category 'do-its') -----
  	"Treat the current selection as an expression; evaluate it and return the time took for this evaluation"
  	| result rcvr ctxt valueAsString v |
  	self lineSelectAndEmptyCheck: [^ -1].
  	(model respondsTo: #doItReceiver) 
  		ifTrue: [FakeClassPool adopt: model selectedClass.  "Include model pool vars if any"
  				rcvr := model doItReceiver.
  				ctxt := model doItContext]
  		ifFalse: [rcvr := ctxt := nil].
  	result := [ | cm |
  		cm := rcvr class evaluatorClass new 
  			compiledMethodFor: self selectionAsStream
  			in: ctxt
  			to: rcvr
  			notifying: self
  			ifFail: [FakeClassPool adopt: nil. ^ #failedDoit]
  			logged: false.
  		Time millisecondsToRun: 
+ 			[v := cm valueWithReceiver: rcvr arguments: #() ].
- 			[v := cm valueWithReceiver: rcvr arguments: (Array with: ctxt)].
  		on: OutOfScopeNotification 
  		do: [ :ex | ex resume: true].
  	FakeClassPool adopt: nil.
  	"We do not want to have large result displayed"
  	valueAsString := v printString.
  	(valueAsString size > 30) ifTrue: [valueAsString := (valueAsString copyFrom: 1 to: 30), '...'].
  		inform: 'Time to compile and execute: ', result printString, 'ms res: ', valueAsString.

More information about the Squeak-dev mailing list