[Pharo-project] bad bracket autocompletion in Pharo Core 1.2

Fernando olivero fernando.olivero at usi.ch
Mon Oct 11 03:36:52 EDT 2010


Hi , it was a enhancement i did starting from a Chris Muller enhancement for Squeak.

ISSUE 2653.
http://code.google.com/p/pharo/issues/detail?id=2653&can=1&q=auto&colspec=ID%20Type%20Status%20Summary%20Milestone%20Difficulty

I did a test, maybe a good start would be to see if its failing now.

Fernando

On Oct 9, 2010, at 2:18 PM, Juan Vuletich wrote:

> Hi Folks,
> 
> Cuis doesn't include #autoEnclose, so I don't know how it should behave.
> 
> Cheers,
> Juan Vuletich
> 
> Mariano Martinez Peck wrote:
>> Guille, if I remember correctly (not sure), these new classes like 
>> TextEditor and Smalltalk editor came from Cuis. Juan (Cuis author) i 
>> think he is in the mailing list but not read it so frequently. So, for 
>> this issues maybe you can cc'ed him.
>> 
>> Cheers
>> 
>> Mariano
>> 
>> 2010/10/9 Guillermo Polito <guillermopolito at gmail.com 
>> <mailto:guillermopolito at gmail.com>>
>> 
>>    Here is the piece of code that's behaving weird
>> 
>>    TextEditor>>dispatchOn:
>> 
>>    ...
>>    ...
>>    char := aKeyboardEvent keyCharacter.
>>         openers := '([{'. 
>>        closers := ')]}'.
>>           ( closers includes: char) ifTrue: [ self blinkPrevParen:
>>    char ].
>>           result := self normalCharacter: aKeyboardEvent.
>>           (self class autoEnclose and: [ openers includes: char ]) 
>>    not ifTrue: [ ^ result  ].
>>        suffix := closers at: (openers indexOf: char).
>>        paragraph text append: suffix asString.
>>          self moveCursor: [ : position | position  ] forward: true
>>    specialBlock: [ : pos | "no special behavior" ] event:
>>    aKeyboardEvent .
>>        self userHasEdited.
>> 
>>    -------------------------------------
>> 
>>    So, if I evaluate "TextEditor autoEnclose: false", it is stops
>>    behaving like that :)
>> 
>>    What should be the desired behavior?  Having it configurable as it
>>    is today but fix the strange bracket adding? remove this behavior?
>>    I can't find now how ParagraphEditor did this.
>> 
>>    Guille
>> 
>> 
>>    On Wed, Oct 6, 2010 at 10:34 PM, Guillermo Polito
>>    <guillermopolito at gmail.com <mailto:guillermopolito at gmail.com>> wrote:
>> 
>>        Yes, the issue can be reduced to:
>> 
>>        open parenthesis (or brackets), then something else (anywhere
>>        in the editor).
>> 
>>        2010/10/6 Mariano Martinez Peck <marianopeck at gmail.com
>>        <mailto:marianopeck at gmail.com>>
>> 
>>            I detected a similar problem:
>> 
>>            once you type an opening parenthesis, and then something
>>            else, it adds a new one at the END of the code
>> 
>>            check http://code.google.com/p/pharo/issues/detail?id=2939
>> 
>>            2010/10/6 Guillermo Polito <guillermopolito at gmail.com
>>            <mailto:guillermopolito at gmail.com>>
>> 
>>                http://code.google.com/p/pharo/issues/detail?id=3069
>> 
>>                if you type:
>> 
>>                [] -> []]
>> 
>>                () -> ())
>> 
>>                {} -> {}}
>> 
>> 
>> 
>> 
>>                Bye!
>> 
>>                _______________________________________________
>>                Pharo-project mailing list
>>                Pharo-project at lists.gforge.inria.fr
>>                <mailto:Pharo-project at lists.gforge.inria.fr>
>>                http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>> 
>> 
>> 
>>            _______________________________________________
>>            Pharo-project mailing list
>>            Pharo-project at lists.gforge.inria.fr
>>            <mailto:Pharo-project at lists.gforge.inria.fr>
>>            http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>> 
>> 
>> 
>> 
>>    _______________________________________________
>>    Pharo-project mailing list
>>    Pharo-project at lists.gforge.inria.fr
>>    <mailto:Pharo-project at lists.gforge.inria.fr>
>>    http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>> 
>> 
>> ------------------------------------------------------------------------
>> 
>> 
>> No virus found in this incoming message.
>> Checked by AVG - www.avg.com 
>> Version: 9.0.862 / Virus Database: 271.1.1/3184 - Release Date: 10/08/10 03:34:00
>> 
>> 
> 
> 
> _______________________________________________
> Pharo-project mailing list
> Pharo-project at lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20101011/fe29ce3a/attachment-0001.html>


More information about the Pharo-dev mailing list