[Pkg] The Trunk: Morphic-nice.560.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Aug 3 22:15:06 UTC 2011


Nicolas Cellier uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-nice.560.mcz

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

Name: Morphic-nice.560
Author: nice
Time: 4 August 2011, 12:13:33.583 am
UUID: f816651e-2c1a-402f-b4be-d7fc194061a0
Ancestors: Morphic-nice.559

Correct forwardDelete: that I just broke.
Note that (cmd+z) fail to undo this action. I think it was previously the case before I changed anything.

=============== Diff against Morphic-nice.559 ===============

Item was changed:
  ----- Method: TextEditor>>forwardDelete: (in category 'typing/selecting keys') -----
  forwardDelete: aKeyboardEvent
  	"Delete forward over the next character.
  	  Make Undo work on the whole type-in, not just the one char.
  	wod 11/3/1998: If there was a selection use #zapSelectionWith: rather than #backspace: which was 'one off' in deleting the selection. Handling of things like undo or typeIn area were not fully considered."
  	| startIndex usel upara uinterval ind stopIndex |
  	startIndex := self markIndex.
  	startIndex > self text size ifTrue: [
  		^ false].
  	self hasSelection ifTrue: [
  		"there was a selection"
  		self zapSelectionWith: self nullText.
  		^ false].
  	"Null selection - do the delete forward"
  	beginTypeInIndex ifNil: [	"no previous typing.  openTypeIn"
  		self openTypeIn. UndoSelection := self nullText].
  	uinterval := UndoInterval copy.
  	upara := UndoParagraph copy.
  	stopIndex := startIndex.
  	(aKeyboardEvent keyValue = 127 and: [ aKeyboardEvent shiftPressed ])
+ 		ifTrue: [stopIndex := (self nextWord: stopIndex) - 1].
- 		ifTrue: [stopIndex := (self nextWordStart: stopIndex) - 1].
  	self selectFrom: startIndex to: stopIndex.
  	self replaceSelectionWith: self nullText.
  	self selectFrom: startIndex to: startIndex-1.
  	UndoParagraph := upara.  UndoInterval := uinterval.
  	UndoMessage selector == #noUndoer ifTrue: [
  		(UndoSelection isText) ifTrue: [
  			usel := UndoSelection.
  			ind := startIndex. "UndoInterval startIndex"
  			usel replaceFrom: usel size + 1 to: usel size with:
  				(UndoParagraph text copyFrom: ind to: ind).
  			UndoParagraph text replaceFrom: ind to: ind with: self nullText]].
  	^false!



More information about the Packages mailing list