The Trunk: ST80-mt.263.mcz

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

The Trunk: ST80-mt.263.mcz

commits-2
Marcel Taeumel uploaded a new version of ST80 to project The Trunk:
http://source.squeak.org/trunk/ST80-mt.263.mcz

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

Name: ST80-mt.263
Author: mt
Time: 6 January 2021, 10:33:34.521417 am
UUID: 06e12acc-4e20-0c4c-9e25-ca0838ccf765
Ancestors: ST80-mt.262

Fixes auto-indent bug in MVC text editors by supporting type-aheads with size > 1 outside the context of copy-paste (and similar) in #zapSelectionWithCompositionWith:.

Note that dynamic character composition is not supported in Morphic's TextEditor, I suppose. We might want to add that, too. Yoshiki added this feature in 2007 only to ST80/MVC.

=============== Diff against ST80-mt.262 ===============

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: [
- 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 zapSelectionWith: aText.
  !