The Trunk: Tools-mt.862.mcz

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

The Trunk: Tools-mt.862.mcz

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

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

Name: Tools-mt.862
Author: mt
Time: 4 August 2019, 12:07:44.136314 pm
UUID: d52b05de-7a3d-184c-9243-32be566fcea1
Ancestors: Tools-mt.861

Merges Tools-ct.858, which I moved to treated inbox due to incompatible ancestry.

"Inspector: Try to keep field selection when changing object

Instead of unselecting the field viewed latest when another object is assigned, keep the selection unless it is no more valid (got a phantom)

Example where this is useful: debug World allMorphs, select owner in the receiver view and watch the selection while stepping a few times into #allMorphsDo:."

=============== Diff against Tools-mt.861 ===============

Item was changed:
  ----- Method: Inspector>>object: (in category 'accessing') -----
  object: anObject
  "Set anObject to be the object being inspected by the receiver."
 
+ | oldSelection oldFields newFields commonFieldRange |
- | oldIndex |
  anObject == object
  ifTrue: [self update]
  ifFalse:
+ [oldSelection := selectionIndex.
+ oldFields := self fieldList.
- [oldIndex := selectionIndex <= 2 ifTrue: [selectionIndex] ifFalse: [0].
  self inspect: anObject.
+ newFields := self fieldList.
+ commonFieldRange := ((1 to: (oldFields size min: newFields size))
+ select: [:i | (oldFields at: i) = (newFields at: i)])
+ ifNotEmpty: #last
+ ifEmpty: [0].
- oldIndex := oldIndex min: self fieldList size.
  self changed: #inspectObject.
+ self toggleIndex: (oldSelection <= commonFieldRange
+ ifTrue: [oldSelection]
+ ifFalse: [0]).
- oldIndex > 0
- ifTrue: [self toggleIndex: oldIndex].
  self changed: #fieldList.
  self changed: #contents.
  self changed: #helpText]!