The Inbox: Morphic-ct.1743.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

The Inbox: Morphic-ct.1743.mcz

commits-2
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]!


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Morphic-ct.1743.mcz

Christoph Thiede
To be precise, Chromium/Blink and Microsoft Windows also truly advance the
selection on the first arrow press iff the command/control is pressed. But
personally, I think this is rather inconsistent and inconvenient so I
aligned this edge case with the regular behavior without specialBlock ...

Best,
Christoph



-----
Carpe Squeak!
--
Sent from: http://forum.world.st/Squeak-Dev-f45488.html

Carpe Squeak!