Comment #1 on issue 3402 by stephane.ducasse: SmalltalkEditor new raises an
Error
http://code.google.com/p/pharo/issues/detail?id=3402The #changeParagraph: is bogus:
changeParagraph: aParagraph
"Install aParagraph as the one to be edited by the receiver."
self resetState
TextEditor>>paragraph is following:
paragraph
^ morph
ifNotNil: [morph paragraph]
I changed the TextEditor, for creating and initializing it not like:
TextEditor new
but like:
TextEditor newForMorph: morph
in that way, TextEditor>>paragraph always works.
And for same reason, i removed the #changeParagraph: ,
because it useless.
Also, the following test is now should be rewritten:
CompilerEvaluationTest>>testEvaluationOfSelfSend
SmalltalkEditorTest >> testCompilationOfUndefinedVar
they using old SmalltalkEditor new, instead of (newForMorph:)
as well as using #changeParagraph:
So, creating SmalltalkEditor can be done like:
morph := NewTextMorph new.
morph paragraph: paragraph.
editor := SmalltalkEditor newForMorph: morph.