Bug+fix in ClassCommentPlugin

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

Bug+fix in ClassCommentPlugin

Chris Uppal-3
Hi,

I've found why class comments are not being word-wrapped in D6; it's a bug in
ClassCommentPlugin's initialisation.

Its implementation of #initialize does

    initialize
        super initialize.
        textPresenter view wordWrap: self class wordWrap.
        self refreshIcon

but the view is not available at that time, so both operations have no effect.
Thus the text presenter's settings are taken from those of SmalltalkWorkspace
(or its configured replacement) and never changed by ClassCommentPlugin.
Since I have #wordWrap turned on for comment fields, but turned off for code
fields, class comments are incorrectly not wrapped.

One fix is to remove #initialize and replace it with an override of
#onViewOpened

    onViewOpened
        super onViewOpened.
        textPresenter view wordWrap: self class wordWrap.
        self refreshIcon

    -- chris


Reply | Threaded
Open this post in threaded view
|

Re: Bug+fix in ClassCommentPlugin

Blair
"Chris Uppal" <[hidden email]> wrote in message
news:44acf210$0$781$[hidden email]...
> Hi,
>
> I've found why class comments are not being word-wrapped in D6; it's a bug
> in
> ClassCommentPlugin's initialisation....

Thanks Chris, will be fixed as your suggestion in forthcoming release.

Blair