Levente Uzonyi uploaded a new version of ST80 to project The Trunk:
http://source.squeak.org/trunk/ST80-ul.119.mcz ==================== Summary ==================== Name: ST80-ul.119 Author: ul Time: 12 November 2010, 3:47:06.755 am UUID: 8f4aeba3-646e-0346-b54c-6beb87b1777c Ancestors: ST80-dtl.118 - fix: http://bugs.squeak.org/view.php?id=1005 - deprecated ParagraphEditor >> #blinkPrevParen =============== Diff against ST80-dtl.118 =============== Item was changed: ----- Method: ParagraphEditor>>blinkPrevParen (in category 'parenblinking') ----- blinkPrevParen + + self deprecated: 'Use #blinkPrevParen:'. + self blinkPrevParen: sensor keyboardPeek! - | openDelimiter closeDelimiter level string here hereChar | - string := paragraph text string. - here := startBlock stringIndex. - openDelimiter := sensor keyboardPeek. - closeDelimiter := '([{' at: (')]}' indexOf: openDelimiter). - level := 1. - [level > 0 and: [here > 2]] - whileTrue: - [hereChar := string at: (here := here - 1). - hereChar = closeDelimiter - ifTrue: - [level := level - 1. - level = 0 - ifTrue: [^ self blinkParenAt: here]] - ifFalse: - [hereChar = openDelimiter - ifTrue: [level := level + 1]]].! Item was added: + ----- Method: ParagraphEditor>>blinkPrevParen: (in category 'parenblinking') ----- + blinkPrevParen: aCharacter + | openDelimiter closeDelimiter level string here hereChar | + string := paragraph text string. + here := startBlock stringIndex. + openDelimiter := aCharacter. + closeDelimiter := '([{' at: (')]}' indexOf: openDelimiter). + level := 1. + [level > 0 and: [here > 1]] + whileTrue: + [hereChar := string at: (here := here - 1). + hereChar = closeDelimiter + ifTrue: + [level := level - 1. + level = 0 + ifTrue: [^ self blinkParenAt: here]] + ifFalse: + [hereChar = openDelimiter + ifTrue: [level := level + 1]]].! Item was changed: ----- Method: ParagraphEditor>>dispatchOnCharacter:with: (in category 'parenblinking') ----- dispatchOnCharacter: char with: typeAheadStream "Carry out the action associated with this character, if any. Type-ahead is passed so some routines can flush or use it." + | honorCommandKeys result | - | honorCommandKeys | self clearParens. "mikki 1/3/2005 21:31 Preference for auto-indent on return added." char asciiValue = 13 ifTrue: [ ^Preferences autoIndent ifTrue: [ sensor controlKeyPressed ifTrue: [self normalCharacter: typeAheadStream] ifFalse: [self crWithIndent: typeAheadStream]] ifFalse: [ sensor controlKeyPressed ifTrue: [self crWithIndent: typeAheadStream] ifFalse: [self normalCharacter: typeAheadStream]]]. ((honorCommandKeys := Preferences cmdKeysInText) and: [char = Character enter]) ifTrue: [^ self dispatchOnEnterWith: typeAheadStream]. "Special keys overwrite crtl+key combinations - at least on Windows. To resolve this conflict, assume that keys other than cursor keys aren't used together with Crtl." ((self class specialShiftCmdKeys includes: char asciiValue) and: [char asciiValue < 27]) ifTrue: [^ sensor controlKeyPressed ifTrue: [self perform: (ShiftCmdActions at: char asciiValue + 1) with: typeAheadStream] ifFalse: [self perform: (CmdActions at: char asciiValue + 1) with: typeAheadStream]]. "backspace, and escape keys (ascii 8 and 27) are command keys" ((honorCommandKeys and: [sensor commandKeyPressed]) or: [self class specialShiftCmdKeys includes: char asciiValue]) ifTrue: [^ sensor leftShiftDown ifTrue: [self perform: (ShiftCmdActions at: char asciiValue + 1 ifAbsent: [#noop:]) with: typeAheadStream] ifFalse: [self perform: (CmdActions at: char asciiValue + 1 ifAbsent: [#noop:]) with: typeAheadStream]]. "the control key can be used to invoke shift-cmd shortcuts" (honorCommandKeys and: [sensor controlKeyPressed]) ifTrue: [^ self perform: (ShiftCmdActions at: char asciiValue + 1 ifAbsent: [#noop:]) with: typeAheadStream]. - (')]}' includes: char) - ifTrue: [self blinkPrevParen]. + result := self perform: #normalCharacter: with: typeAheadStream. + + (')]}' includes: char) + ifTrue: [self blinkPrevParen: char ]. + ^result! - ^ self perform: #normalCharacter: with: typeAheadStream! |
Free forum by Nabble | Edit this page |