[issue35208] IDLE: Squeezed lines count ignores window width

2018-12-23 Thread Tal Einat
Tal Einat added the comment: > Part of my thinking with the simple auto-squeeze formula, besides just > simplifying the code, it this. Raymond claimed that squeezing slows down > printing. If measurably true, one way to avoid a slow down would be to use a > simple heuristic formula to

[issue35208] IDLE: Squeezed lines count ignores window width

2018-12-20 Thread Terry J. Reedy
Terry J. Reedy added the comment: Tal, trying to understand your confused description of what behavior you want to fix required me to experiment and think. There are at least 2 separate issues: triggering of auto-squeeze and lines reported (regardless of what triggers squeezing). The

[issue35208] IDLE: Squeezed lines count ignores window width

2018-12-15 Thread Tal Einat
Tal Einat added the comment: Terry, I'm not sure I follow your thinking, but it feels like over-thinking. This is a simple bug with a simple fix. Barring the current bug (which the attached PR fixes), the current logic counts lines, taking soft wrapping into account. This was chosen to

[issue35208] IDLE: Squeezed lines count ignores window width

2018-12-14 Thread Terry J. Reedy
Terry J. Reedy added the comment: My suggest simple rule would sqeeze it. With n = 50 and k = 75, if len(s) > n*k or s.count('\n') > n: squeeze(s) would squeeze at 3750. With k = 50, as 2500. I am not sure yet what to do about wrapping. For development, a count of actual lines might be

[issue35208] IDLE: Squeezed lines count ignores window width

2018-12-13 Thread Tal Einat
Tal Einat added the comment: My mistake on the reproduction; try: print('a'*1+'\n'). It does not trigger auto-squeezing, though this is an obvious case where it should be triggered. (Manual squeezing also results in showing just 1 as the line count.) --

[issue35208] IDLE: Squeezed lines count ignores window width

2018-12-13 Thread Terry J. Reedy
Terry J. Reedy added the comment: There are 2 questions. 1. Should we review squeezer, in light of further complemplation and experience, and possibly patch it in a couple of weeks or so? Yes. 2. Is there such a severe bug that we should possibly rush a fix and ask Ned to cherry-pick

[issue35208] IDLE: Squeezed lines count ignores window width

2018-12-13 Thread Tal Einat
Tal Einat added the comment: Note the lack of newline at the end; that triggers the problematic path in the current calculation. -- ___ Python tracker ___

[issue35208] IDLE: Squeezed lines count ignores window width

2018-12-13 Thread Tal Einat
Tal Einat added the comment: As I mentioned when opening this issue: 'a'*200 (or 'a'*1). -- ___ Python tracker ___ ___

[issue35208] IDLE: Squeezed lines count ignores window width

2018-12-13 Thread Terry J. Reedy
Terry J. Reedy added the comment: In the example I gave on the PR, 200 70 char lines, the squeezed box says 200 lines with or without line wrapping (before the patch). What is a simple case that you think is buggy? -- ___ Python tracker

[issue35208] IDLE: Squeezed lines count ignores window width

2018-12-13 Thread Tal Einat
Tal Einat added the comment: Squeezer currently does take wrapping into account, i.e. it does take IDLE's "soft" line wrapping into account when counting lines. Therefore the auto-squeeze criterion of "at least X lines" does lead to auto-squeezing for any mixture of very long lines and/or

[issue35208] IDLE: Squeezed lines count ignores window width

2018-12-12 Thread Terry J. Reedy
Terry J. Reedy added the comment: Note that I *am* considering ... It seems that a reasonable rule might be to squeeze if n lines or the equivalent of n full lines (75 chars each) in total characters. In other words, if lines >= N or chars >= to 75*N: squeeze(). Do we have a rule not to

[issue35208] IDLE: Squeezed lines count ignores window width

2018-12-12 Thread Terry J. Reedy
Terry J. Reedy added the comment: Changing the width of the window changes the number of visible lines because of line wrapping. But it does not change the number of logical lines. My understanding is that squeezer currently reports the latter, and that is not necessarily a bug. Not that

[issue35208] IDLE: Squeezed lines count ignores window width

2018-12-11 Thread Terry J. Reedy
Change by Terry J. Reedy : -- versions: -Python 3.6 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35208] IDLE: Squeezed lines count ignores window width

2018-11-09 Thread Tal Einat
Tal Einat added the comment: See PR GH-10449 with a fix. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35208] IDLE: Squeezed lines count ignores window width

2018-11-09 Thread Tal Einat
Change by Tal Einat : -- keywords: +patch pull_requests: +9724 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-list

[issue35208] IDLE: Squeezed lines count ignores window width

2018-11-09 Thread Tal Einat
New submission from Tal Einat : Squeezing a single long line with a newline, e.g. 'a'*200, results in "Squeezed text (1 lines)". Also, changing the width of the window (even to very small widths) doesn't affect the number of lines reported when squeezing (when squeezing *after* the width