-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
bpo-35208: Fix IDLE Squeezer line counting #10449
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
bpo-35208: Fix IDLE Squeezer line counting #10449
Conversation
73e0fea
to
675b42f
Compare
675b42f
to
01fa746
Compare
@terryjreedy, this is a bugfix and I really think it should go into 3.6 before it's too late. Would you like to review this or can I just merge it? |
It is semi too late in that the rcs are already out. We would have to commit to 3.8 and 3.7.2+ and request cherry-pick to the two release branches. However, the plural issue is not critical, and as I said on issue, I don't necessarily consider reporting logical lines to be a bug. If I have misunderstood the issue, please clarify. |
Example: |
At the moment, I cannot make any changes, or even make an inline comment. Same as for #11214. |
All tests continue to pass.
Tests continue to pass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added news items and made a couple of changes. If you are happy with them, go ahead and merge.
Lib/idlelib/squeezer.py
Outdated
# (1,0), even though a new line hadn't yet been started. The same | ||
# is true if length is any exact multiple of linewidth. Therefore, | ||
# subtract 1 before dividing a non-empty line. | ||
if current_column > linewidth: # Don't bother adding 0. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change does avoid the current_column == 0
edge-case, but the way it is now written (including the comment) makes it seem like a questionable optimization rather than handling an important edge-case (which happens with empty lines).
I suggest at least expanding the comment, e.g.:
# Avoid the `current_column == 0` edge-case, and while we're at it,
# don't bother adding 0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment is already longer than I would like, but I did not readily see how to nicely condense it. A bit more will not hurt.
@terryjreedy, thanks for the review and improvements! I have a few comments, let me know what you think. |
Thanks @taleinat for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7. |
GH-11305 is a backport of this pull request to the 3.7 branch. |
(cherry picked from commit 44a79cc) Co-authored-by: Tal Einat <taleinat+github@gmail.com>
This also fixes the label when squeezing a single line to "Squeezed text (1 line)", rather than "Squeezed text (1 lines)".
https://bugs.python.org/issue35208