if it works go ahead ;)

Ben

On Mar 28, 2013, at 12:48 PM, Norbert Hartl <[email protected]> wrote:

> 
> Am 28.03.2013 um 11:51 schrieb stephane ducasse <[email protected]>:
> 
>> 
>> On Mar 28, 2013, at 11:21 AM, Norbert Hartl <[email protected]> wrote:
>> 
>>> What is the rationale for having the method pane as multi-select list? I 
>>> don't think it is of greater use when editing code. I could imagine that 
>>> some refactoring tasks could be easier having multi-select lists.
>>> 
>>> Anyway, if I try to rename a method without using the refactoring engine I 
>>> just change the selector, save and delete the method with the old selector. 
>>> In pharo 2.0 when you rename a method and then click on the old selector 
>>> both methods are selected and shortcut invocation for deleting deletes 
>>> both. Which is quite annoying. In my opinion there is no reason for two 
>>> methods being selected. If you agree I'll happily enter a bug.
>> 
>> 
>> The problem is not a nautilus bug but a compiled method one if I remember 
>> correctly.
>> because two methods with the same body are equal.
>> 
> It happens in MethodWidget>>#methodSelectionAt:put. When 
> PluggableIconListMorph updates the list selection it calls the MethodWidget 
> to set true on the new method selected. But MethodWidget uses a Dictionary 
> for instVar methodSelection and finds the old method being equal and enables 
> this.
> As I don't see a reason why a selection should be done by equality this 
> behavior can be fixed by using an IdentityDictionary.
> 
> Fix:
> 
> MethodWidget>>#initialize
> 
>       super initialize.
>       methodsSelection := IdentityDictionary new.
> 
> Any arguments?
> 
> Norbert

Reply via email to