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
IDLE: Make multiple improvements to CodeContext #77791
Comments
|
There are a number of possible improvements to CodeContext. They be separate issues (and PRs) that are dependencies of this master index issue. Some should be fairly easy now that we have the new tests.
|
|
|
For item 2 - bpo-33628 |
|
With bpo-33628 merged, I consider the next priorities to be 5. bpo-22703 (overt bug, highest), 7, and 8, to make the feature more usable.
More feasible than item 10 would be
16A. Replace update loop with notification of visible display changes. Pro: We already monitor key and mouse actions. Anti: the event loop is simple. 16B. Only run update loop in active window. Anti: I don't think we currently monitor window focus. Pro: if we don't, we will need to for a multipane, multitab IDLE. (Stopping should be easy: check status before after call in callback. This automatically does a last update after focus gone.) |
|
I've started looking at bpo-22703, more specifically, I've been trying to recreate it. Since the config changes in 3.6/3.7 where the flag was removed from config dialog, the code context needs to be turned on explicitly for each editor. 3.5 has the old behavior. So, I think the current change would be to add it back to config but with the behavior defined in bpo-22703. I hope to have a PR within the next few days. |
|
For item 7 - bpo-33642. |
|
While trying out variable lines, bpo-33642, I encounter two related issues. First is the context colors. Black on gray is a variant of black on white. I am using the dark theme, white on dark blue. For fixed sized context, the high contrast is okay. For variable context, having lines flip from light on dark to dark on light and back is distracting to obnoxious. So I want to change Second is getting partial lines at the top of the text box as a result of scrolling with the mousewheel or scrollbar slider. I never liked this but tolerated it. With complete text lines above, it looks awful to me. Hence, I consider the following to be a dependency of this issue. Following the implementation notes for bpo-33664, once the label is changes to text, to get the target topline, 8. can be implemented with I would like to release multiple user visible improvements at once, at least 7, 9, and 17, so the new code context looks good from the start. 8, menu changes, and 14 could come later. |
|
For item 9 - bpo-33679 |
|
The release candidate has been re-scheduled for June 11. So we should be able to merge the minimal upgrade before that and get it in 3.7.0 and 3.6.6. (The latter will come out at the same time as the former.) Variable lines is about ready. Colors looks like it should be, with a final test needed after variable lines is merged (or maybe I will reverse the order). That leaves line alignment. If you are working on it, but don't have a PR ready yet, please say so. |
|
5, reformulated. Now that 'Code Context' on the Options menu only toggles a feature for the current window, like 'Zoom Height' on the Window menu, both should appear together on the same menu. My current inclination is to move 'Code Context' to Window because a) it is the feature be that will be changed and discussed in What's New, and b) 'Window' otherwise lists individual windows so it more clearly implies that toggles are for the current window without adding a fake menu entry. Agree? |
|
|
I was going to work on it this weekend, but haven't started yet. I agree that moving Code Context to the Windows menu makes sense. |
|
I merged 'variable lines' and edited 'colors' to fix the resulting conflicts. Travis passed the latter so I expect to merge it also. To avoid more conflicts, you should wait to create the 'alignment' branch until 'colors' is merged and pulled into your clone. (We should continue to keep having two pending patches for the same file rare.) Counter-argument for menu location. Window has 1 to n top-level window items. Options will have just one item without Code Context. So moving Zoom would make things more balanced. |
|
After writing the above, I realized that line scroll only touches editor.py, not codecontext.py. On the other hand, the next item, 8. jump to context line did have to wait. Replacing Label with Text will require explicit height setting with each context change. The click handler will be a simplified version of the scroll handler you just wrote. Jumping to a line will look much better when it jumps to a whole rather than a fractional line. Again, one of us should say something before starting. |
|
For item 11 - bpo-33763 |
|
Menu location: If Code Context is moved under Windows, maybe Configure IDLE should be moved as well?
|
|
General Update: We have done 1, 3, 7, 8, 9, 11, 17, 21. Very nice. A re-organized list of the remainder (with old numbers). Docs: Menu Code Context Display Internal Changes External Changes D1 is PR 7579 and backports. D2 was done on bpo-33820 and bpo-33821. For M1, I would still like to move Zoom Height to Options with a separate bar after IDLE settings. |
|
D1 in bpo-35521. |
|
For M1 and M2 - bpo-22703. |
|
For M3 - bpo-35555. |
|
I2: replace font/hightlight loop with notification and immediate change instead of a delay is a bugfix. In testing PR 14675 for bpo-37530 I discovered a bug. 'Show' always shows a single blank line, as if the top visible line were the top line of the file. One should not have to scroll to trigger the context calculation. This exists now, prior to the new PR. If/when we add a hotkey (M4), once should be able to show, see context, and hide just by hitting hotkey twice. Add C3: Make 'Show' show the context for the current top visible line. |
|
Terry, on latest master (with the aforementioned PR merged), the context is updated quickly after the code-context is shown. This happens after a delay of up to 100ms due to the update loop. I've created PR #59026 with a fix. |
|
Regarding validating integer inputs in the configuration dialog (E3), see my new PR #59027. |
|
E4. Max context lines = 0 is treated as infinity. For depth 0, "self.info[-self.context_depth:]" is whole slice. I don't remember if this is intended (if one does not want context, don't toggle it on), but it is not documented in settings help or doc section. In any case, E5. test_codecontext is affected by user customization, but should not be. E6. Bad bug make CC useless. See bpo-42638. |
|
Delete E6. No bug. I do have a couple of internal edits. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: