Pass empty placement explicitly in bar replace
cmd_replace fed $PLACEMENT_FROM_SECTION/$PLACEMENT_FROM_INDEX to jq without ever calling parse_placement, so they were always empty strings that implied flag support which does not exist. Pass literal empties with a comment stating replace resolves by widget id only. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
54539b4a83
commit
03f7420d72
+4
-2
@@ -756,11 +756,13 @@ cmd_replace() {
|
||||
| .bar.layout[\$source.section][\$source.index].id = \$new
|
||||
JQ
|
||||
)
|
||||
# resolve_source finds by widget id when no placement is given; replace
|
||||
# takes no placement flags, so pass empty placement explicitly.
|
||||
commit "$prog" \
|
||||
--arg widgetId "$old" \
|
||||
--arg new "$new" \
|
||||
--arg fromSection "$PLACEMENT_FROM_SECTION" \
|
||||
--arg fromIndex "$PLACEMENT_FROM_INDEX"
|
||||
--arg fromSection "" \
|
||||
--arg fromIndex ""
|
||||
echo "Replaced $old with $new"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user