[squeak-dev] The Trunk: ST80-dtl.141.mcz

commits at source.squeak.org commits at source.squeak.org
Sat Feb 9 01:01:51 UTC 2013


David T. Lewis uploaded a new version of ST80 to project The Trunk:
http://source.squeak.org/trunk/ST80-dtl.141.mcz

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

Name: ST80-dtl.141
Author: dtl
Time: 8 February 2013, 8:01:05.105 pm
UUID: f838c540-19cd-4828-bcce-242b8ff4d30b
Ancestors: ST80-nice.140

Fix ParagraphEditor>>zapSelectionWithCompositionWith: failing to reset setMark or setPoint values after converting to Unicode in the case of an input string of length > 1. The problem was apparent only in the case of keyboard entry from MVC when a wait2ms delay causing two or more characters to be buffered prior to handling the zap selection. Problem was best exhibited using a Linux interpreter VM with poor delay time resolution. This update fixes the problem in MVC but has not been tested with Unicode input (author is using US English keyboard and locale).

Problem identified by Bob Arning: http://lists.squeakfoundation.org/pipermail/squeak-dev/2013-February/168666.html

=============== Diff against ST80-nice.140 ===============

Item was changed:
  ----- Method: ParagraphEditor>>zapSelectionWithCompositionWith: (in category 'accessing-selection') -----
  zapSelectionWithCompositionWith: aString
  	"Deselect, and replace the selection text by aString.
  	 Remember the resulting selectionInterval in UndoInterval and otherInterval.
  	 Do not set up for undo."
  
  	| stream newString aText beforeChar |
  	wasComposition := false.
  	((aString isEmpty or: [(beforeChar := self charBefore) isNil]) or: [
  		aString size = 1 and: [(Unicode isComposition: aString first) not]]) ifTrue: [
  			^ self zapSelectionWith: (Text string: aString emphasis: emphasisHere)].
  
  	stream := UnicodeCompositionStream on: (String new: 16).
  	stream nextPut: beforeChar.
  	stream nextPutAll: aString.
  	newString := stream contents.
  	aText := Text string: newString emphasis: emphasisHere.
- 	self markBlock < self pointBlock
- 		ifTrue: [self setMark: self markBlock stringIndex - 1]
- 		ifFalse: [self setPoint: self  pointBlock stringIndex - 1].
- 
  	wasComposition := true. 
+ 	self markBlock < self pointBlock
+ 		ifTrue: [ self setMark: self markBlock stringIndex - 1.
+ 				self zapSelectionWith: aText.
+ 				self setMark: self markBlock stringIndex + 1]
+ 		ifFalse: [ self setPoint: self pointBlock stringIndex - 1.
+ 				self zapSelectionWith: aText.
+ 				self setPoint: self pointBlock stringIndex + 1]
- 	self zapSelectionWith: aText.
  !



More information about the Squeak-dev mailing list