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

commits at source.squeak.org commits at source.squeak.org
Mon Nov 16 05:07:29 UTC 2015


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

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

Name: Morphic-cmm.1040
Author: cmm
Time: 15 November 2015, 11:06:42.328 pm
UUID: 912689c9-ab7b-461d-92b3-177f671fde54
Ancestors: Morphic-tpr.1039

- Consolidate Command+hg into, more-simply, Command+g, recovering the lowercase "h" hot-key for future use.  Hot keys have become a valuable commodity.
- Fix the in-place search-and-replace function.  Command+g and j now function together, harmoniously, for the user.

=============== Diff against Morphic-tpr.1039 ===============

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:].
  	
+ 	cmds := #($a #selectAll: $c #copySelection: $e #exchange: $f #find: $g #findAgain: $j #doAgain: $k #offerFontMenu: $u #align: $v #paste: $w #backWord: $x #cut: $y #swapChars: $z #undo:).
- 	cmds := #($a #selectAll: $c #copySelection: $e #exchange: $f #find: $g #findAgain: $h #setSearchString: $j #doAgain: $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>>findAgain: (in category 'typing/selecting keys') -----
  findAgain: aKeyboardEvent 
+ 	| previousHistory |
+ 	previousHistory := self history previous.
+ 	self
+ 		 insertAndCloseTypeIn ;
+ 		 findAgainSettingSearch: (previousHistory isNil or: [ previousHistory hasReplacedSomething not ]).
- 	"Find the desired text again.  1/24/96 sw"
- 
- 	self insertAndCloseTypeIn.
- 	self findAgain.
  	^ true!

Item was added:
+ ----- Method: TextEditor>>findAgainSettingSearch: (in category 'menu messages') -----
+ findAgainSettingSearch: aBoolean 
+ 	aBoolean ifTrue:
+ 		[ self hasSelection ifTrue:
+ 			[ self setSearch: self selection string ] ].
+ 	self findAgain!

Item was changed:
  ----- Method: TextEditor>>findReplaceAgain (in category 'menu messages') -----
  findReplaceAgain
  
  	| where |
  	self hasSelection ifTrue: [
  		"Search from the beginning of the current selection. Supports a nice combination with regular find feature."
  		self selectInvisiblyFrom: self startIndex to: self startIndex - 1].
  	
  	where := self text
  				findString: FindText
+ 				startingAt: self stopIndex-FindText size
- 				startingAt: self stopIndex
  				caseSensitive: Preferences caseSensitiveFinds.
  	
  	where = 0 ifTrue: [^ false].
  
  	self selectInvisiblyFrom: where to: where + FindText size - 1.
  	self replaceSelectionWith: ChangeText.
  
  	^ true!

Item was changed:
  ----- Method: TextEditor>>mouseMove: (in category 'events') -----
+ mouseMove: evt 
- mouseMove: evt
  	"Change the selection in response to mouse-down drag"
- 
  	pointBlock := paragraph characterBlockAtPoint: evt position.
+ 	self
+ 		 storeSelectionInParagraph ;
+ 		 setSearch: self selection string!
- 	self storeSelectionInParagraph!

Item was changed:
  ----- Method: TextEditor>>selectFrom:to: (in category 'new selection') -----
  selectFrom: start to: stop
  	"Select the specified characters inclusive."
  	self selectInvisiblyFrom: start to: stop.
  	self closeTypeIn.
  	self storeSelectionInParagraph.
  	"Preserve current emphasis if selection is empty"
  	stop > start ifTrue: [
+ 		self setEmphasisHere ].
+ 	self hasSelection ifTrue: [ self setSearch: self selection string ]!
- 		self setEmphasisHere ]!

Item was removed:
- ----- Method: TextEditor>>setSearchString: (in category 'nonediting/nontyping keys') -----
- setSearchString: aKeyboardEvent
- 	"Establish the current selection as the current search string."
- 
- 	| aString |
- 	self insertAndCloseTypeIn.
- 	self lineSelectAndEmptyCheck: [^ true].
- 	aString :=  self selection string.
- 	aString size = 0
- 		ifTrue:
- 			[self flash]
- 		ifFalse:
- 			[self setSearch: aString].
- 	^ true!



More information about the Squeak-dev mailing list