Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Console] fix emojis messing up the line width#40524

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
nicolas-grekas merged 1 commit intosymfony:5.2fromMarionLeHerisson:ticket_37904
Mar 23, 2021

Conversation

@MarionLeHerisson
Copy link
Contributor

@MarionLeHerissonMarionLeHerisson commentedMar 19, 2021
edited
Loading

QA
Branch?5.2
Bug fix?yes
New feature?no
Deprecations?no
TicketsFix#37904
LicenseMIT

Description

The emojis, because they take as much space as two characters, would cause the console to display too many spaces to complete a line, which made it uneven, as described in the issue.

The fix uses thewidth function instead ofstrlen. To answer@ogizanagi's comment, yes it does work with "composed" emojis.

Before :

image

After :

image

Other changes

Removed two unused lines of code, the value of$messageLineLength was never used.

Note

I'd like to add some tests, but I don't know how since I think this depends on console client width ?

Thanks for your reviews 🙏

lyrixx, welcoMattic, ternel, bastnic, OskarStark, chalasr, pyrech, qboot, yceruto, damienalexandre, and ceciledelmon reacted with thumbs up emojiro0NL and damienalexandre reacted with hooray emoji
@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has acontribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (seehttps://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (seehttps://symfony.com/releases)
  • Features and deprecations must be submitted against the 5.x branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@MarionLeHerissonMarionLeHerisson changed the title[Command] fix emojis messing up the line width[WIP][Command] fix emojis messing up the line widthMar 19, 2021
@carsonbotcarsonbot changed the title[WIP][Command] fix emojis messing up the line width[Console] [WIP][Command] fix emojis messing up the line widthMar 20, 2021
@chalasr
Copy link
Member

chalasr commentedMar 20, 2021
edited
Loading

Do we really need a new method? Can't we updatestrlenWithoutDecoration() instead? (I may miss some potential issues due to the behavior change.)
The name of the new method does not make it obvious that it is all about strings.
So if we cannot just updatestrlenWithoutDecoration(), we should try to find a more meaningful name. PerhapsstringWidthWithoutDecoration() or similar?

@MarionLeHerisson
Copy link
ContributorAuthor

MarionLeHerisson commentedMar 22, 2021
edited
Loading

Hello@chalasr, thanks for the feedback. Since the method is used in 13 other places in the code, I was afraid it would break something. But after trying it and running the tests, it seems it doesn't 👍

@MarionLeHerissonMarionLeHerisson changed the title[Console] [WIP][Command] fix emojis messing up the line width[Console] fix emojis messing up the line widthMar 22, 2021
add tests + removed irrelevant method
Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

(I applied my own review comment and fixed a few more things found meanwhile)

MarionLeHerisson reacted with thumbs up emoji
@nicolas-grekas
Copy link
Member

Thank you@MarionLeHerisson.

@Nyholm
Copy link
Member

I like this feature, however, it caused some regressions. I will revert this an add it as a new feature in 5.3 instead.

See#40697

Awilum added a commit to thermage/thermage that referenced this pull requestOct 18, 2021
symfony/symfony#40524will be investigated and implemented in future Termage releases
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@chalasrchalasrAwaiting requested review from chalasrchalasr is a code owner

@dunglasdunglasAwaiting requested review from dunglas

@jderussejderusseAwaiting requested review from jderusse

@lyrixxlyrixxAwaiting requested review from lyrixx

@OskarStarkOskarStarkAwaiting requested review from OskarStark

@srozesrozeAwaiting requested review from sroze

@wouterjwouterjAwaiting requested review from wouterj

@xabbuhxabbuhAwaiting requested review from xabbuh

@ycerutoycerutoAwaiting requested review from yceruto

Assignees

No one assigned

Projects

None yet

Milestone

5.2

Development

Successfully merging this pull request may close these issues.

Console with emoji mess up the formatting

5 participants

@MarionLeHerisson@carsonbot@chalasr@nicolas-grekas@Nyholm

[8]ページ先頭

©2009-2025 Movatter.jp