-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clamp index in case all examples are active
- Loading branch information
Showing
2 changed files
with
5 additions
and
3 deletions.
There are no files selected for viewing
6 changes: 4 additions & 2 deletions
6
packages/Babylonian-ProbeLog.package/BPProbeLogColumnMorph.class/class/menuSelectionItems.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
accessing | ||
menuSelectionItems | ||
|
||
| examples | | ||
| examples firstInactiveIndex | | ||
examples := (BPExamples value examples asSortedCollection: [:a :b | | ||
a isActive asNumber > b isActive asNumber ]) asOrderedCollection. | ||
examples add: #- beforeIndex: (examples findFirst: [:anExample | anExample isActive not]). | ||
firstInactiveIndex := examples findFirst: [:anExample | anExample isActive not]. | ||
(firstInactiveIndex == 0) ifTrue: [firstInactiveIndex := 1]. | ||
examples add: #- beforeIndex: firstInactiveIndex. | ||
|
||
^ {BPNilExample new}, examples |
2 changes: 1 addition & 1 deletion
2
packages/Babylonian-ProbeLog.package/BPProbeLogColumnMorph.class/methodProperties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters