The #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.


-- 
Best regards,
Igor Stasenko AKA sig.

Attachment: NewTextMorph-TextEditor-fixes.1.cs
Description: Binary data

Reply via email to