-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
bpo-17535: IDLE editor line numbers #14030
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-17535: IDLE editor line numbers #14030
Conversation
* refactored from an extension into an integral part of IDLE * got tests working * various required fixes * some code cleanup and stylistic changes
also refactor the state of BaseSideBar and LineNumbers
I'd love to see line number finally landing in IDLE. I use it a lot for teaching and it'll be a great help referencing parts of the code. |
* avoid duplicate scrolling events which degrade performance * reorganize event forwarding code * dragging on line numbers now selects entire lines * work around difficult to handle drag-scrolling
This is apparently unnecessary.
I've made some significant improvements in several aspects:
|
Taking advantage of the tighter integration with EditorWindow, each window now directly updates its line numbers sidebar upon font changes.
There is apparently a minor inconsistency in Tk's Text widget.
1893bf2
to
b7faf1f
Compare
Tal, thank you for reviving the improving the old patch. This seems to work better than the 2014 version, enough so I want to get this into b3 (scheduled in 3 weeks, 7/29). If we can coordinate, I will help with the needed changes. (I believe some of them amount to fixing parts of the old patch that are now obsolete.) I would like to immediately follow up with a shell sidebar, which will, among other things, separate prompt and code and allow properly spaced indents instead of the wonky tabbing. (we might do something else immediately, but I want it eventually.) I will try to post something for discussion tomorrow. Issues (couple of which would be separate).
This happens with custom themes every time we add theme elements. We immediately need to extend previous workaround, but should do a more permanent fix that adds elements, with default values, to custom themes.
The default size of a Text widget with all lines the same height (as in IDLE) is an even number of lines, and when this is true, there are no partial lines to worry about. When a user changes the window height to have a fractional size, IDLE (without this patch) puts a whole line at the top and the fractional line at the bottom. I intend that this remain true. While using the patch, I discovered that when one scrolls to the bottom of the file, the fractional line moves to the top. It stays there until one scrolls to the top or until the widget just switches back. This looks even worse with line numbers, so a fix would be good if it can be done without making scrolling on macOS worse. (1? adjust window size to an integral number of line after a resize? 2? display a partial unnumbered blank line, like Notepad++.)
|
|
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.
See separate comments. Will look at code later.
When you're done making the requested changes, leave the comment: |
The doc looks even better. |
Thanks @taleinat for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8. |
I'm having trouble backporting to |
Sorry, @taleinat, I could not cleanly backport this to |
Thanks @taleinat for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7. |
Thanks @taleinat for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8. |
Sorry @taleinat, I had trouble checking out the |
(cherry picked from commit 7123ea0) Co-authored-by: Tal Einat <taleinat@gmail.com>
GH-14916 is a backport of this pull request to the 3.8 branch. |
(cherry picked from commit 7123ea0) Co-authored-by: Tal Einat <taleinat@gmail.com>
GH-14917 is a backport of this pull request to the 3.7 branch. |
Line numbers for IDLE editor windows!
This is based on Saimadhav Heblikar's last patch posted to the related issue.
https://bugs.python.org/issue17535