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 <[email protected]
> 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 <[email protected]>
>
> 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 <[email protected]>
>>
>>> http://code.google.com/p/pharo/issues/detail?id=3069
>>>
>>> if you type:
>>>
>>> [] -> []]
>>>
>>> () -> ())
>>>
>>> {} -> {}}
>>>
>>>
>>>
>>> Bye!
>>>
>>> _______________________________________________
>>> Pharo-project mailing list
>>> [email protected]
>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>
>>
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [email protected]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>
>
_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project