[squeak-dev] The Inbox: Morphic-ct.1743.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Mar 19 23:33:29 UTC 2021


A new version of Morphic was added to project The Inbox:
http://source.squeak.org/inbox/Morphic-ct.1743.mcz

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

Name: Morphic-ct.1743
Author: ct
Time: 20 March 2021, 12:33:20.571756 am
UUID: e9e2e46a-8dc3-4f42-aa90-ccab90c774c3
Ancestors: Morphic-mt.1741

Proposals: Make selection logic in Editor a little bit more convenient. When returning back to caret from a selection, don't move the caret beyond the prior selection interval on the first arrow key hit. This matches behavior in Chromium/Blink and Microsoft Windows.

=============== Diff against Morphic-mt.1741 ===============

Item was changed:
  ----- Method: Editor>>moveCursor:forward:event:specialBlock: (in category 'private') -----
  moveCursor: directionBlock forward: forward event: aKeyboardEvent specialBlock: specialBlock 
  	"Private - Move cursor.
  	directionBlock is a one argument Block that computes the new Position from a given one.
  	specialBlock is a one argumentBlock that computes the new position from a given one under the alternate semantics.
  	Note that directionBlock always is evaluated first."
  	| indices newPosition shouldSelect |
  	shouldSelect := aKeyboardEvent shiftPressed.
  	indices := self setIndices: shouldSelect forward: forward.
+ 	newPosition := indices at: #moving.
+ 	(shouldSelect not and: [self hasSelection]) ifFalse: [
+ 		newPosition := directionBlock value: newPosition.
+ 		(aKeyboardEvent commandKeyPressed or: [aKeyboardEvent controlKeyPressed])
+ 			ifTrue: [newPosition := specialBlock value: newPosition]].
- 	newPosition := directionBlock value: (indices at: #moving).
- 	(aKeyboardEvent commandKeyPressed or: [aKeyboardEvent controlKeyPressed])
- 		ifTrue: [newPosition := specialBlock value: newPosition].
  	shouldSelect
  		ifTrue: [self selectMark: (indices at: #fixed) point: newPosition - 1]
  		ifFalse: [self selectAt: newPosition]!



More information about the Squeak-dev mailing list