[squeak-dev] The Trunk: Morphic-cmm.452.mcz

commits at source.squeak.org commits at source.squeak.org
Sat Jul 3 00:22:37 UTC 2010


Chris Muller uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-cmm.452.mcz

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

Name: Morphic-cmm.452
Author: cmm
Time: 2 July 2010, 7:21:27.827 pm
UUID: 256fdb5f-e51a-463a-94b1-05ca25e3c8bd
Ancestors: Morphic-eem.451

Removed Command+, command-key from enclosing in <>'s for the following reasons:

	1) It is already correctly handled by Control+[comma].  There is little or no need for this enclosing character to exist at all in SmalltalkEditor, in particular because Squeak has Seaside which eliminates the need to type a lot of HTML enclosing brackets.  But to _overload_ this command with two separate hot-key combinations is insane.
	2) Control+[surround key] is universally consistent for the shifted enclosing characters, e.g., $(, ${.  $< should follow suit.  $[, on the other hand, is not shifted on the keyboard, and therefore uses the standard Command key, not Control.
	3) It's a pain in the ass.  I'm finally fed up because, every day, I am accidently hitting the , (comma) key when I mean to only hit the Command key to browse senders, or "do it" or save a method.

Unnecessary, inconsistent, overloaded, and painful.  Whew!  Goodbye and good riddance.

=============== Diff against Morphic-eem.451 ===============

Item was changed:
  ----- Method: TextEditor class>>initializeCmdKeyShortcuts (in category 'keyboard shortcut tables') -----
  initializeCmdKeyShortcuts
  	"Initialize the (unshifted) command-key (or alt-key) shortcut table."
  
  	"NOTE: if you don't know what your keyboard generates, use Sensor kbdTest"
  
  	"TextEditor initialize"
  
  	| cmdMap cmds |
  	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: #backspace:.				"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:.			"cmd-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: 127 + 1 put: #forwardDelete:.		"del key"
  			
  	'0123456789-=' 
  		do: [:char | cmdMap at: char asciiValue + 1 put: #changeEmphasis:].
  		
  	'([{''"<' do: [:char | cmdMap at: char asciiValue + 1 put: #enclose:].
  	
- 	cmdMap at: $, asciiValue + 1 put: #shiftEnclose:.
- 	
  	cmds := #($a #selectAll: $c #copySelection: $e #exchange: $f #find: $g #findAgain: $h #setSearchString: $k #offerFontMenu: $u #align: $v #paste: $w #backWord: $x #cut: $y #swapChars: $z #undo:).
  	1 to: cmds size
  		by: 2
  		do: [:i | cmdMap at: (cmds at: i) asciiValue + 1 put: (cmds at: i + 1)].
  		
  	cmdActions := cmdMap!

Item was changed:
  ----- Method: TextEditor>>enclose: (in category 'editing keys') -----
  enclose: characterStream
  	"Insert or remove bracket characters around the current selection.
  	 Flushes typeahead."
  
  	| char left right startIndex stopIndex oldSelection which text |
  	char := sensor keyboard.
  	self closeTypeIn.
  	startIndex := self startIndex.
  	stopIndex := self stopIndex.
  	oldSelection := self selection.
+ 	which := '([{"''' indexOf: char ifAbsent: [ ^true ].
+ 	left := '([{"''' at: which.
+ 	right := ')]}"''' at: which.
- 	which := '([<{"''' indexOf: char ifAbsent: [ ^true ].
- 	left := '([<{"''' at: which.
- 	right := ')]>}"''' at: which.
  	text := paragraph text.
  	((startIndex > 1 and: [stopIndex <= text size])
  			and: [ (text at: startIndex-1) = left and: [(text at: stopIndex) = right]])
  		ifTrue: [
  			"already enclosed; strip off brackets"
  			self selectFrom: startIndex-1 to: stopIndex.
  			self replaceSelectionWith: oldSelection]
  		ifFalse: [
  			"not enclosed; enclose by matching brackets"
  			self replaceSelectionWith:
  				(Text string: (String with: left), oldSelection string, (String with: right) attributes: emphasisHere).
  			self selectFrom: startIndex+1 to: stopIndex].
  	^true!

Item was changed:
  (PackageInfo named: 'Morphic') postscript: '(Preferences dictionaryOfPreferences at: #alternativeWindowBoxesLook) defaultValue: false.
+ SystemProgressMorph initialize; reset.
+ TextEditor initialize.
+ SmalltalkEditor initialize'!
- SystemProgressMorph initialize; reset'!




More information about the Squeak-dev mailing list