[squeak-dev] The Trunk: ST80-ct.258.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Apr 13 00:03:26 UTC 2021


Nicolas Cellier uploaded a new version of ST80 to project The Trunk:
http://source.squeak.org/trunk/ST80-ct.258.mcz

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

Name: ST80-ct.258
Author: ct
Time: 5 September 2020, 1:20:54.682421 am
UUID: db2a2f67-e818-ea46-b2f6-f4a9950577db
Ancestors: ST80-mt.257

Fixes home and end keys in MVC editors if the text is empty

=============== Diff against ST80-mt.257 ===============

Item was changed:
  ----- Method: ParagraphEditor>>cursorEnd: (in category 'nonediting/nontyping keys') -----
  cursorEnd: characterStream 
  
  	"Private - Move cursor end of current line."
  	| string |
  	self closeTypeIn: characterStream.
  	string := paragraph text string.
  	self
  		moveCursor:
  			[:position | Preferences wordStyleCursorMovement
+ 				ifTrue: [
+ 					paragraph lines	
+ 						at: (paragraph lineIndexOfCharacterIndex: position)
+ 						ifPresent: [:targetLine | targetLine last + (targetLine last = string size) asBit]
+ 						ifAbsent: [position]]
+ 				ifFalse: [
- 				ifTrue:[| targetLine |
- 					targetLine := paragraph lines at:(paragraph lineIndexOfCharacterIndex: position).
- 					targetLine = paragraph lines last
- 						ifTrue:[targetLine last + 1]
- 						ifFalse:[targetLine last]]
- 				ifFalse:[
  					string
  						indexOfAnyOf: CharacterSet crlf
  						startingAt: position
  						ifAbsent:[string size + 1]]]
  		forward: true
  		specialBlock:[:dummy | string size + 1].
  	^true!

Item was changed:
  ----- Method: ParagraphEditor>>cursorHome: (in category 'nonediting/nontyping keys') -----
  cursorHome: characterStream 
  
  	"Private - Move cursor from position in current line to beginning of
  	current line. If control key is pressed put cursor at beginning of text"
  
  	| string |
  
  	string := paragraph text string.
  	self
+ 		moveCursor: [:position | Preferences wordStyleCursorMovement
+ 				ifTrue: [
+ 					paragraph lines
+ 						at: (paragraph lineIndexOfCharacterIndex: position)
+ 						ifPresent: [:targetLine | targetLine first]								 						ifAbsent: [position]]
- 		moveCursor: [ :position | Preferences wordStyleCursorMovement
- 				ifTrue:[
- 					(paragraph lines at:(paragraph lineIndexOfCharacterIndex: position)) first]
  				ifFalse:[
  					(string
  						lastIndexOfAnyOf: CharacterSet crlf
  						startingAt: position - 1) + 1]]
  		forward: false
  		specialBlock: [:dummy | 1].
  	^true!



More information about the Squeak-dev mailing list