Skip to content

Recompute command path padding when a parent is attached - #2495

Open
AshSgDe29071999 wants to merge 1 commit into
spf13:mainfrom
AshSgDe29071999:fix/command-path-padding-add-order
Open

AshSgDe29071999 wants to merge 1 commit into
spf13:mainfrom
AshSgDe29071999:fix/command-path-padding-add-order

Conversation

@AshSgDe29071999

Copy link
Copy Markdown

CommandPathPadding was snapshotted in AddCommand from CommandPath() at that moment. Building a subtree before attaching it to the root used short paths (authentication instead of app remote authentication), so help columns stayed misaligned.

After the parent pointer is set, recompute max lengths down the subtree.

Fixes #2463

Test

go test . -run TestCommandPathPaddingIndependentOfAddOrder -count=1

CommandPathPadding was snapshotted in AddCommand from CommandPath at
that moment. Building a subtree before attaching it to the root used
short paths, so help columns stayed misaligned.

Recompute max lengths after the parent pointer is set.

See spf13#2463
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Help output depends on the order AddCommand is called (CommandPathPadding is snapshotted, never recomputed)

2 participants