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

Fixes #40633: Progress bar is broken when progress bar character is unicode.#40635

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

Closed
grasmash wants to merge3 commits intosymfony:5.2fromgrasmash:patch-8

Conversation

@grasmash
Copy link
Contributor

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

@Nyholm
Copy link
Member

Thank you for this PR.

Could you add a test to this bug?

$display =str_repeat($bar->getBarCharacter(),$completeBars);
if ($completeBars <$bar->getBarWidth()) {
$emptyBars =$bar->getBarWidth() -$completeBars - Helper::strlenWithoutDecoration($output->getFormatter(),$bar->getProgressCharacter());
$display .=$bar->getProgressCharacter().str_repeat($bar->getEmptyBarCharacter(),$emptyBars);
Copy link
Member

Choose a reason for hiding this comment

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

IMHO the issue is:$emptyBars should not be negative

Nyholm reacted with thumbs up emoji

Choose a reason for hiding this comment

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

I agree the issue is deeper, there is a confusion in the component between "width" and "length".
Helper::strlen() deals with "width", and there is no helper to deal with "length", while it would be needed: a single simple-width character might be enough to replace a single double-width character. To be confirmed of course.

Copy link
Member

Choose a reason for hiding this comment

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

See this PR#40695

Am I correct?

@grasmash
Copy link
ContributorAuthor

grasmash commentedMar 31, 2021
edited
Loading

Maybe we should just revert the change that caused this? It seems like the issue extends beyond the scope of the progress bar.

fabpot added a commit that referenced this pull requestApr 8, 2021
…, grasmash)This PR was merged into the 5.2 branch.Discussion----------[Console] Add Helper::width() and Helper::length()| Q             | A| ------------- | ---| Branch?       | 5.2| Bug fix?      | yes| New feature?  | no| Deprecations? | no| Tickets       |Close#40697Fix#40634,fix#40635| License       | MIT| Doc PR        |This PR will add add a Helper::strwidth() and a Helper::strlength(). Same with with the Helper::strlenWithoutDecoration(). It does not deprecate anything. That is done in#40695With this PR we dont have to revert the emoji issue (ieclose#40697)FYI@grasmash, I used your tests from#40635Commits-------d9ea4c5 Add test.dc02ab3 [Console] Add Helper::strwidth() and Helper::strlength()
@fabpotfabpot closed thisApr 8, 2021
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

@jderussejderussejderusse left review comments

@NyholmNyholmNyholm left review comments

@chalasrchalasrAwaiting requested review from chalasrchalasr is a code owner

Assignees

No one assigned

Projects

None yet

Milestone

5.2

Development

Successfully merging this pull request may close these issues.

6 participants

@grasmash@Nyholm@nicolas-grekas@jderusse@fabpot@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp