-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[Console] Table column max width / formatted text wrapping #10300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
symfony-splitter
pushed a commit
to symfony/console
that referenced
this issue
Sep 11, 2018
This PR was squashed before being merged into the 4.2-dev branch (closes #28373). Discussion ---------- [Console] Support max column width in Table | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | #22156, #27832 | License | MIT | Doc PR | symfony/symfony-docs#10300 Continuation of #22225 to better preserve spaces (which preserves background colors), using `wordwrap` it caused some issues. Also the wrapping was plain wrong by not taking the current line length into account. While at it, it comes with `Table` integration :) Given ```php $table = new Table($output); $table->setColumnMaxWidth(0, 2); $table->setRow(0, ['pre <error>foo bar baz</error> post']); $table->render(); $table = new Table($output); $table->setColumnMaxWidth(0, 3); $table->setRow(0, ['pre <error>foo bar baz</error> post']); $table->render(); $table = new Table($output); $table->setColumnMaxWidth(0, 4); $table->setRow(0, ['pre <error>foo bar baz</error> post']); $table->render(); ```  Commits ------- 175f68f [Console] Support max column width in Table
chalasr
pushed a commit
to symfony/symfony
that referenced
this issue
Sep 11, 2018
This PR was squashed before being merged into the 4.2-dev branch (closes #28373). Discussion ---------- [Console] Support max column width in Table | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | #22156, #27832 | License | MIT | Doc PR | symfony/symfony-docs#10300 Continuation of #22225 to better preserve spaces (which preserves background colors), using `wordwrap` it caused some issues. Also the wrapping was plain wrong by not taking the current line length into account. While at it, it comes with `Table` integration :) Given ```php $table = new Table($output); $table->setColumnMaxWidth(0, 2); $table->setRow(0, ['pre <error>foo bar baz</error> post']); $table->render(); $table = new Table($output); $table->setColumnMaxWidth(0, 3); $table->setRow(0, ['pre <error>foo bar baz</error> post']); $table->render(); $table = new Table($output); $table->setColumnMaxWidth(0, 4); $table->setRow(0, ['pre <error>foo bar baz</error> post']); $table->render(); ```  Commits ------- 175f68f [Console] Support max column width in Table
Fixed by #10394. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
symfony/symfony#22225 + symfony/symfony#28373
The text was updated successfully, but these errors were encountered: