The Trunk: Tools-cmm.528.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-cmm.528.mcz

commits-2
Chris Muller uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-cmm.528.mcz

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

Name: Tools-cmm.528
Author: cmm
Time: 24 September 2014, 7:58:54.026 pm
UUID: ebf29995-8cb8-47d5-bb07-0f86d2f530ba
Ancestors: Tools-eem.527

- Guard from empty possibilities when inverting the level selection of a MessageTrace.

=============== Diff against Tools-eem.527 ===============

Item was changed:
  ----- Method: MessageTrace>>invertLevelSelection (in category 'actions') -----
  invertLevelSelection
  "The user wants to be able to quickly and easily assemble message-traces.  When browsing senders or implementors of a heavily overloaded selector, typically just one or two messages are relevant out of several.  In that situation, the user need merely select the range of relevant methods to arrive within two gestures of trimming the irrelevant methods:  Command+I (capital eye) to invert the selection within the local group followed by Command+d to remove that selection from the browser."
  | index currentLevel start |
  currentLevel := self currentIndentionLevel ifNil:
  [ | possibilities |
  possibilities := ((1 to: messageSelections size) select:
  [ : idx | messageSelections at: idx ]) collect:
  [ : eachSelectedIndex | self indentionLevelAt: eachSelectedIndex ].
  possibilities asSet size > 1
  ifTrue: [ ^ self ]
  ifFalse:
+ [ possibilities ifEmpty: [ ^ self ].
+ start := messageSelections indexOf: true.
- [ start := messageSelections indexOf: true.
  possibilities anyOne ] ].
  "First invert at messageListIndex then crawl up and down from there until a different level is reached, inverting as we go."
  messageListIndex > 0 ifTrue: [ start := messageListIndex ].
  self toggleMessageSelectionAt: start.
  index := start.
  [ index := index - 1.
  index > 0 and: [ (self indentionLevelAt: index) = currentLevel ] ] whileTrue: [ self toggleMessageSelectionAt: index ].
  index := start.
  [ index := index + 1.
  index <= messageList size and: [ (self indentionLevelAt: index) = currentLevel ] ] whileTrue: [ self toggleMessageSelectionAt: index ].
  self
  messageListIndex: 0 ;
  changed: #messageList!