<div dir="ltr"><table cellpadding="0" class="" style="font-size:16px"><tbody><tr class=""><td class="" style="width:558px"><table cellpadding="0" class="" style="width:558px"><tbody><tr><td><h3 class=""><span name="Stéphane Rollandin" class="" style="font-size:16px;font-weight:normal">Stéphane Rollandins fix should be in the release image.</span></h3><div><span name="Stéphane Rollandin" class="" style="font-size:16px;font-weight:normal">That bug is really annoying</span></div><div><span name="Stéphane Rollandin" class="" style="font-size:16px;font-weight:normal"><br></span></div><div><span name="Stéphane Rollandin" class="" style="font-size:16px;font-weight:normal">Karl</span></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 19, 2015 at 3:20 PM, Stéphane Rollandin <span dir="ltr"><<a href="mailto:lecteur@zogotounga.net" target="_blank">lecteur@zogotounga.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
It seems that "Auto Enclose" is not honored correctly. It is disabled in my<br>
image but still seems to be enabled. :-(<br>
<br>
Try typing "()" then move the cursor between the parentheses and type the<br>
closing one again. You will not end up with to closing ones...<br>
</blockquote>
<br></span>
Yes, I noticed that also, and it bothered me enough that I fixed it by modifying TextEditor>> #dispatchOnKeyboardEvent: as follow:<br>
<br>
----------------------------------------------<br>
<br>
dispatchOnKeyboardEvent: aKeyboardEvent<span class=""><br>
"Carry out the action associated with this character, if any. Type-ahead is passed so some routines can flush or use it."<br></span><span class="">
| honorCommandKeys openers closers result typedChar |<br></span><span class="">
((typedChar := aKeyboardEvent keyCharacter) == Character cr and: [ morph acceptOnCR ]) ifTrue:<br></span>
[ self closeTypeIn.<span class=""><br>
^ true ].<br>
self clearParens.<br></span><span class="">
aKeyboardEvent keyValue = 13 ifTrue:<br></span><span class="">
[ aKeyboardEvent controlKeyPressed ifTrue: [ ^ self normalCharacter: aKeyboardEvent ].<br></span><span class="">
aKeyboardEvent shiftPressed ifTrue: [ ^ self lf: aKeyboardEvent ].<br></span><span class="">
aKeyboardEvent commandKeyPressed ifTrue: [ ^ self crlf: aKeyboardEvent ].<br></span><span class="">
^ self crWithIndent: aKeyboardEvent ].<br></span><span class="">
((honorCommandKeys := Preferences cmdKeysInText) and: [ typedChar = Character enter ]) ifTrue: [ ^ self dispatchOnEnterWith: aKeyboardEvent ].<br></span><span class="">
"Special keys overwrite crtl+key combinations - at least on Windows. To resolve this<br>
conflict, assume that keys other than cursor keys aren't used together with Crtl."<br></span><span class="">
((self class specialShiftCmdKeys includes: aKeyboardEvent keyValue) and: [ aKeyboardEvent keyValue < 27 ]) ifTrue: [ ^ aKeyboardEvent controlKeyPressed<br></span><span class="">
ifTrue:<br>
[ self<br>
perform: (self class shiftCmdActions at: aKeyboardEvent keyValue + 1)<br>
with: aKeyboardEvent ]<br></span><span class="">
ifFalse:<br>
[ self<br>
perform: (self class cmdActions at: aKeyboardEvent keyValue + 1)<br>
with: aKeyboardEvent ] ].<br>
"backspace, and escape keys (ascii 8 and 27) are command keys"<br></span><span class="">
((honorCommandKeys and: [ aKeyboardEvent commandKeyPressed ]) or: [ self class specialShiftCmdKeys includes: aKeyboardEvent keyValue ]) ifTrue: [ ^ aKeyboardEvent shiftPressed<br></span><span class="">
ifTrue:<br>
[ self<br>
perform: (self class shiftCmdActions at: aKeyboardEvent keyValue + 1)<br>
with: aKeyboardEvent ]<br></span><span class="">
ifFalse:<br>
[ self<br>
perform: (self class cmdActions at: aKeyboardEvent keyValue + 1)<br>
with: aKeyboardEvent ] ].<br>
"the control key can be used to invoke shift-cmd shortcuts"<br></span><span class="">
(honorCommandKeys and: [ aKeyboardEvent controlKeyPressed ]) ifTrue: [ ^ self<br></span><span class="">
perform: (self class shiftCmdActions at: aKeyboardEvent keyValue + 1)<br>
with: aKeyboardEvent ].<br>
openers := '([{'.<br>
closers := ')]}'.<br></span>
(closers includes: typedChar)<br>
ifTrue:<br>
[ self blinkPrevParen: typedChar.<br>
(self class autoEnclose and: [self nextNonwhitespaceCharacter = typedChar])<br>
ifTrue:<span class=""><br>
[ self moveCursor: [ : position | position + 1 ] forward: true select: false.<br></span>
^ false ]<span class=""><br>
ifFalse: [ result := self normalCharacter: aKeyboardEvent ] ]<br></span><span class="">
ifFalse: [ result := self normalCharacter: aKeyboardEvent ].<br></span><span class="">
(self class autoEnclose and: [ openers includes: typedChar ]) ifTrue:<br></span>
[ self<span class=""><br>
addString: (closers at: (openers indexOf: typedChar)) asString ;<br></span>
insertTypeAhead ;<span class=""><br>
<br>
moveCursor:<br>
[ : position | position - 1 ]<br></span>
forward: false<br>
select: false ].<br>
^ result<br>
<br>
<br>
----------------------------------------------<br>
<br>
It looks like a correct fix to me.<br>
<br>
Best,<br>
<br>
Stef<br>
<br>
<br>
<br>
</blockquote></div><br></div>