Hi nicolas Tx I fixed it before seeing your email. Too bad.
I introduced this bug when I did the asLayoutFrame conversion. Note that I split the refactoring in parts to avoid too change commits. Now I was also thinking how I could automate the change and this is not that easy because the expressions can use temps, instance variables... and it would take me age to be able to write a rewrite expression (sadly enough). I found it in 3 min because I know the changes I did but your way is quite nice because it was not easy to find from the stack trace. I fixed it but I cannot commit the fix. Iceberg does not let me. Now I cannot produce a PR. :( https://pharo.fogbugz.com/f/cases/20656/Nautilus-comment-panel-got-broken-by-asLayoutFrame-cleans Guille told me that I could modify the printOn: method to help me. And this is a bit better (I did not bother to be smart with ; or not) I will use this trick to ease the refactoring and minimize errors (probably sleeping more should help too and doing less boring tasks too :). printOn: aStream aStream nextPutAll: ' (LayoutFrame identity '. self leftFraction = 0 ifFalse: [ aStream << ('leftFraction: ', self leftFraction printString, ' ') ]. self topFraction = 0 ifFalse: [ aStream << ('topFraction: ', self topFraction printString, ' ') ]. self rightFraction = 1 ifFalse: [ aStream << ('rightFraction: ', self rightFraction printString, ' ') ]. self bottomFraction = 1 ifFalse: [ aStream << ('bottomFraction: ', self bottomFraction printString,' ') ]. self leftOffset = 0 ifFalse: [ aStream << ('leftOffset: ', self leftOffset printString,' ') ]. self topOffset = 0 ifFalse: [ aStream << ('topOffset: ', self topOffset printString,' ') ]. self rightOffset = 0 ifFalse: [ aStream << ('rightOffset: ', self rightOffset printString,' ') ]. self bottomOffset = 0 ifFalse: [ aStream << ('bottomOffset: ', self bottomOffset printString,' ') ]. aStream nextPutAll: ' ) ' On Wed, Nov 8, 2017 at 1:58 PM, Sven Van Caekenberghe <[email protected]> wrote: > Yeah, I just got in trouble too by looking at class comments. > > Heroic debugging, Nicolas ! > >> On 8 Nov 2017, at 13:47, Nicolas Cellier >> <[email protected]> wrote: >> >> Hi, >> don't you get nice red-cross when opening a browser and selecting comment? >> (Pharo7.0-32bit-b5ec533.image) >> >> The problem is LayoutFrame having a Point instead of Number in >> fraction/offset inst. var. >> >> So I defined two horrible hacks in order to be able to work with Pharo >> >> Point>>@ n ^x @ n >> Point>>asInteger ^x asInteger >> >> then could instrument the LayoutFrame inst. var. setters with horrible >> checks like: >> aNumber isNumber ifFalse: [ self halt]. >> >> And after a few seconds of IDE usage: >> >> AbstractNautilusUI>>buildCodePanelWithCommentOnRight >> ...snip... >> sourceCodePanel >> addMorph: commentWidget >> fullFrame: (LayoutFrame identity leftFraction: 0.5@0 ; >> leftOffset: delta). >> >> Huh! it's as pleasant as not eating own dog food >> I think this comes from a recent refactoring. I can hardly use in image >> tools to trace it. >> Iceberg bugs, MC has lost ancestry and is just good at synchronizing disk >> working copy with image working copy, but there is github & git API: >> >> https://github.com/pharo-project/pharo/commit/042baad47fddb63db2dd0beefeec692962f06dfe#diff-b8c1cff56276a5a583eec641253123da >> >> As it's nearly impossible to make giant refactorings like this without human >> error, >> and as it's as impossible to review pull request with many lines of code, >> I wonder if it is possible to automate those with rewrite rules... >> >> I let you finish the work (open issue, patch, commit, etc...) >> >> > >
