Thanks!<div><br></div><div>Richo<br><br><div class="gmail_quote">On Fri, Oct 7, 2011 at 5:49 AM,  <span dir="ltr">&lt;<a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Bert Freudenberg uploaded a new version of Morphic to project The Trunk:<br>
<a href="http://source.squeak.org/trunk/Morphic-Richo.583.mcz" target="_blank">http://source.squeak.org/trunk/Morphic-Richo.583.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Morphic-Richo.583<br>
Author: Richo<br>
Time: 6 October 2011, 4:29:55.07 pm<br>
UUID: 4df53f26-036e-3c4a-8a98-af5e787d3ada<br>
Ancestors: Morphic-ul.582<br>
<br>
After installing OCompletion typing any of the following characters &#39;)]}&#39; signals an MNU: Character&gt;&gt;#keyCharacter.<br>
<br>
This commit seems to fix the problem by making SmalltalkEditor&gt;&gt;#blinkPrevParen: always receive a character instead of a KeyboardEvent.<br>
<br>
I lacked the courage to change TextEditor&gt;&gt;#blinkPrevParen: but I think it should be changed as well for consistency.<br>
<br>
=============== Diff against Morphic-ul.582 ===============<br>
<br>
Item was changed:<br>
  ----- Method: SmalltalkEditor&gt;&gt;blinkPrevParen: (in category &#39;parenblinking&#39;) -----<br>
+ blinkPrevParen: aCharacter<br>
- blinkPrevParen: aKeyboardEvent<br>
        &quot;Same as super, but tries to follow the Smalltalk syntax.&quot;<br>
<br>
        | openDelimiter closeDelimiter level string here inside |<br>
        string := paragraph text string.<br>
        here := pointBlock stringIndex.<br>
+       openDelimiter := aCharacter.<br>
-       openDelimiter := aKeyboardEvent keyCharacter.<br>
        closeDelimiter := &#39;([{&#39; at: (&#39;)]}&#39; indexOf: openDelimiter).<br>
        level := 1.<br>
        inside := nil. &quot;Tricky.&quot;<br>
        (here &gt; 1 and: [ (string at: here - 1) = $$ ]) ifTrue: [ ^self ]. &quot;Just a character literal.&quot;<br>
        [ level &gt; 0 and: [ here &gt; 1 ] ] whileTrue: [<br>
                | hereChar |<br>
                hereChar := string at: (here := here - 1).<br>
                inside &quot;Are we inside a comment or string literal?&quot;<br>
                        ifNotNil: [ &quot;Yes.&quot;<br>
                                hereChar = inside ifTrue: [<br>
                                        (here &gt; 1 and: [ (string at: here - 1) ~= inside ])<br>
                                                ifTrue: [ inside := nil ]<br>
                                                ifFalse: [ here := here - 1 ] ] ]<br>
                        ifNil: [<br>
                                (here &gt; 1 and: [ (string at: here - 1) = $$ ]) &quot;Just a character literal.&quot;<br>
                                        ifTrue: [ here := here - 1 ]<br>
                                        ifFalse: [<br>
                                                hereChar<br>
                                                        caseOf: {<br>
                                                                [ closeDelimiter ] -&gt; [<br>
                                                                        (level := level - 1) = 0 ifTrue: [<br>
                                                                                ^self blinkParenAt: here ] ].<br>
                                                                [ openDelimiter ] -&gt; [  level := level + 1 ].<br>
                                                                [ $&quot; ] -&gt; [ inside := $&quot; ].<br>
                                                                [ $&#39; ] -&gt; [ inside := $&#39; ] }<br>
                                                        otherwise: [] ] ] ]!<br>
<br>
Item was changed:<br>
  ----- Method: TextEditor&gt;&gt;dispatchOnKeyboardEvent: (in category &#39;typing support&#39;) -----<br>
  dispatchOnKeyboardEvent: aKeyboardEvent<br>
        &quot;Carry out the action associated with this character, if any.<br>
        Type-ahead is passed so some routines can flush or use it.&quot;<br>
<br>
        | honorCommandKeys openers closers result |<br>
        (aKeyboardEvent keyCharacter == Character cr and: [ morph acceptOnCR ])<br>
                ifTrue: [<br>
                        self closeTypeIn.<br>
                        ^ true ].<br>
        self clearParens.<br>
        aKeyboardEvent keyValue = 13<br>
                ifTrue: [<br>
                        aKeyboardEvent controlKeyPressed<br>
                                ifTrue: [ ^ self normalCharacter: aKeyboardEvent ].<br>
                        aKeyboardEvent shiftPressed<br>
                                ifTrue: [ ^ self lf: aKeyboardEvent ].<br>
                        aKeyboardEvent commandKeyPressed<br>
                                ifTrue: [ ^ self crlf: aKeyboardEvent ].<br>
                        ^ self crWithIndent: aKeyboardEvent ].<br>
        ((honorCommandKeys := Preferences cmdKeysInText) and: [ aKeyboardEvent keyCharacter = Character enter ])<br>
                ifTrue: [ ^ self dispatchOnEnterWith: aKeyboardEvent ]. &quot;Special keys overwrite crtl+key combinations - at least on Windows. To resolve this<br>
        conflict, assume that keys other than cursor keys aren&#39;t used together with Crtl.&quot;<br>
        ((self class specialShiftCmdKeys includes: aKeyboardEvent keyValue) and: [ aKeyboardEvent keyValue &lt; 27 ])<br>
                ifTrue: [<br>
                        ^ aKeyboardEvent controlKeyPressed<br>
                                ifTrue: [ self perform: (self class shiftCmdActions at: aKeyboardEvent keyValue + 1) with: aKeyboardEvent ]<br>
                                ifFalse: [ self perform: (self class cmdActions at: aKeyboardEvent keyValue + 1) with: aKeyboardEvent ] ].      &quot;backspace, and escape keys (ascii 8 and 27) are command keys&quot;<br>


        ((honorCommandKeys and: [ aKeyboardEvent commandKeyPressed ])<br>
                or: [ self class specialShiftCmdKeys includes: aKeyboardEvent keyValue ])<br>
                ifTrue: [<br>
                        ^ aKeyboardEvent shiftPressed<br>
                                ifTrue: [ self perform: (self class shiftCmdActions at: aKeyboardEvent keyValue + 1) with: aKeyboardEvent ]<br>
                                ifFalse: [ self perform: (self class cmdActions at: aKeyboardEvent keyValue + 1) with: aKeyboardEvent ] ].      &quot;the control key can be used to invoke shift-cmd shortcuts&quot;<br>
        (honorCommandKeys and: [ aKeyboardEvent controlKeyPressed ])<br>
                ifTrue: [ ^ self perform: (self class shiftCmdActions at: aKeyboardEvent keyValue + 1) with: aKeyboardEvent ].<br>
        openers := &#39;([{&#39;.<br>
        closers := &#39;)]}&#39;.<br>
        result := self normalCharacter: aKeyboardEvent.<br>
        (closers includes: aKeyboardEvent keyCharacter)<br>
+               ifTrue: [ self blinkPrevParen: aKeyboardEvent keyCharacter].<br>
-               ifTrue: [ self blinkPrevParen: aKeyboardEvent ].<br>
        (self class autoEnclose and: [ openers includes: aKeyboardEvent keyCharacter ])<br>
                ifTrue: [<br>
                        self<br>
                                addString: (closers at: (openers indexOf: aKeyboardEvent keyCharacter)) asString;<br>
                                insertTypeAhead ;<br>
<br>
                                moveCursor: [ :position | position - 1 ]<br>
                                forward: false<br>
                                select: false ].<br>
        ^ result!<br>
<br>
<br>
</blockquote></div><br></div>