Skip to content

Commit

Permalink
expand variadic inputs to their initial slots amount (if any is speci…
Browse files Browse the repository at this point in the history
…fied) when restoring them (i.e. when removing an embedded reporter block)
  • Loading branch information
jmoenig committed Nov 12, 2024
1 parent e4b4e9f commit bf2698b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@
* **Notable Fixes:**
* fixed input names when querying a custom block definition that has no function body script
* hide variadic input arrows in case the number of slots is fixed
* expand variadic inputs to their initial slots amount (if any is specified) when restoring them (i.e. when removing an embedded reporter block)

### 2024-11-12
* threads: fixed input names when querying a custom block definition that has no function body script
* metaprogramming library: new "expand (input) to (n) slots" command
* blocks: hide variadic input arrows in case the number of slots is fixed
* blocks: expand variadic inputs to their initial slots amount (if any is specified) when restoring them (i.e. when removing an embedded reporter block)

### 2024-11-11
* threads: expose a copy of the custom block as "caller" to input slot reaction scripts inside custom block definitions
Expand Down
6 changes: 5 additions & 1 deletion src/blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -1594,6 +1594,10 @@ SyntaxElementMorph.prototype.revertToEmptyInput = function (arg) {
}
this.replaceInput(arg, deflt);
if (deflt instanceof MultiArgMorph) {
if (deflt.initialSlots) {
deflt.collapseAll();
deflt.expandTo(deflt.initialSlots);
}
deflt.refresh();
} else if (deflt instanceof RingMorph) {
deflt.fixBlockColor();
Expand Down Expand Up @@ -14572,7 +14576,7 @@ MultiArgMorph.prototype.collapseAll = function () {
};

MultiArgMorph.prototype.expandTo = function (arity = 0) {
// experimental for custom block arity control in v10.2 only
// experimental in v10.2
var len = this.inputs().length,
i;

Expand Down

0 comments on commit bf2698b

Please sign in to comment.