The Trunk: ST80-cmm.190.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: ST80-cmm.190.mcz

commits-2
Chris Muller uploaded a new version of ST80 to project The Trunk:
http://source.squeak.org/trunk/ST80-cmm.190.mcz

==================== Summary ====================

Name: ST80-cmm.190
Author: cmm
Time: 5 November 2015, 5:03:03.029 pm
UUID: 572cb97d-0dd6-44de-9ced-d92b6a524345
Ancestors: ST80-topa.189

- Keep hot keys consistent between TextEditor and ParagraphEditor.

=============== Diff against ST80-topa.189 ===============

Item was changed:
  ----- Method: ParagraphEditor class>>initializeShiftCmdKeyShortcuts (in category 'keyboard shortcut tables') -----
  initializeShiftCmdKeyShortcuts
  "Initialize the shift-command-key (or control-key) shortcut table."
  "NOTE: if you don't know what your keyboard generates, use Sensor kbdTest"
  "wod 11/3/1998: Fix setting of cmdMap for shifted keys to actually use the
  capitalized versions of the letters.
  TPR 2/18/99: add the plain ascii values back in for those VMs that don't return the shifted values."
 
  | cmdMap |
 
  "shift-command and control shortcuts"
  cmdMap := Array new: 256 withAll: #noop:.  "use temp in case of a crash"
 
  cmdMap at: ( 1 + 1) put: #cursorHome:. "home key"
  cmdMap at: ( 4 + 1) put: #cursorEnd:. "end key"
  cmdMap at: ( 8 + 1) put: #forwardDelete:. "ctrl-H or delete key"
  cmdMap at: (11 + 1) put: #cursorPageUp:. "page up key"
  cmdMap at: (12 + 1) put: #cursorPageDown:. "page down key"
  cmdMap at: (13 + 1) put: #crWithIndent:. "ctrl-Return"
  cmdMap at: (27 + 1) put: #offerMenuFromEsc:. "escape key"
  cmdMap at: (28 + 1) put: #cursorLeft:. "left arrow key"
  cmdMap at: (29 + 1) put: #cursorRight:. "right arrow key"
  cmdMap at: (30 + 1) put: #cursorUp:. "up arrow key"
  cmdMap at: (31 + 1) put: #cursorDown:. "down arrow key"
  cmdMap at: (32 + 1) put: #selectWord:. "space bar key"
  cmdMap at: (45 + 1) put: #changeEmphasis:. "cmd-sh-minus"
  cmdMap at: (61 + 1) put: #changeEmphasis:. "cmd-sh-plus"
  cmdMap at: (127 + 1) put: #forwardDelete:. "del key"
 
  "On some keyboards, these characters require a shift"
  '([<{|"''' do: [:char | cmdMap at: char asciiValue + 1 put: #enclose:].
 
  "NB: sw 12/9/2001 commented out the idiosyncratic line just below, which was grabbing shift-esc in the text editor and hence which argued with the wish to have shift-esc be a universal gesture for escaping the local context and calling up the desktop menu."  
  "cmdMap at: (27 + 1) put: #shiftEnclose:." "ctrl-["
 
  "'""''(' do: [ :char | cmdMap at: (char asciiValue + 1) put: #enclose:]."
 
  "triplet = {character. comment selector. novice appropiated}"
  #(
  ($a argAdvance: false)
  ($b browseItHere: false)
  ($c compareToClipboard: false)
- ($d debugIt: false)
  ($e methodStringsContainingIt: false)
  ($f displayIfFalse: false)
  ($g fileItIn: false)
  ($h cursorTopHome: true)
  ($i exploreIt: false)
  ($j doAgainMany: true)
  ($k changeStyle: true)
+ ($m selectCurrentTypeIn: true)
- ($l outdent: true)
- ($m selectCurrentTypeIn: true)
  ($n referencesToIt: false)
  ($p makeProjectLink: true)
- ($r indent: true)
  ($s search: true)
  ($t displayIfTrue: false)
  ($u changeLfToCr: false)
  ($v pasteInitials: false)
  ($w methodNamesContainingIt: false)
  ($x makeLowercase: true)
  ($y makeUppercase: true)
  ($z makeCapitalized: true)
  )
  select:[:triplet | Preferences noviceMode not or:[triplet third]]
  thenDo:[:triplet |
  cmdMap at: (triplet first asciiValue         + 1) put: triplet second. "plain keys"
  cmdMap at: (triplet first asciiValue - 32 + 1) put: triplet second. "shifted keys"
  cmdMap at: (triplet first asciiValue - 96 + 1) put: triplet second. "ctrl keys"
  ].
 
  ShiftCmdActions := cmdMap!

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 |
  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].
+
+ (char = Character tab and: [ self selection notEmpty ]) ifTrue: [ self tabOrIndent: 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].
 
  result := self normalCharacter: typeAheadStream.
 
  (')]}' includes: char)
  ifTrue: [self blinkPrevParen: char ].
  ^result!

Item was removed:
- ----- Method: ParagraphEditor>>duplicate: (in category 'editing keys') -----
- duplicate: characterStream
- "Paste the current selection over the prior selection, if it is non-overlapping and
- legal.  Flushes typeahead.  Undoer & Redoer: undoAndReselect."
-
- sensor keyboard.
- self closeTypeIn.
- (self hasSelection and: [self isDisjointFrom: otherInterval])
- ifTrue: "Something to duplicate"
- [self replace: otherInterval with: self selection and:
- [self selectAt: self pointIndex]]
- ifFalse:
- [view flash].
- ^true!

Item was added:
+ ----- Method: ParagraphEditor>>tabOrIndent: (in category 'typing/selecting keys') -----
+ tabOrIndent: characterStream
+ self selection
+ ifEmpty: [ self normalCharacter: characterStream ]
+ ifNotEmpty:
+ [ Sensor shiftPressed
+ ifTrue: [ self outdent: characterStream ]
+ ifFalse: [ self indent: characterStream ] ].
+ ^ false!