bpo-39852: IDLE 'Go to line' deletes selection, updates status#18801
bpo-39852: IDLE 'Go to line' deletes selection, updates status#18801terryjreedy merged 6 commits intopython:masterpython/cpython:masterfrom
Conversation
Clearing any selection prevents accidental deletion. The update is for Ln and Col on the status bar.
|
@taleinat @csabella It would be nice to have this tested on Mac and Linux (Ubuntu). A minimal test: in shell, enter something after the prompt and select some of it. Open goto box, enter 2, close by clicking OK Selected text should remain but selection highlight should be gone. Status bar should be updated. Previously, at least on windows, selection highlight remained and status Ln, Col were not updated. For more: Repeat but close with Enter key, and without selection. Everything should work in editor too. Edit: I previously forgot to include the '@'s to get this emailed to you. I plan to merge tomorrow to work on at least one of two other issues touching the function, but testing after merge, or after another patch or two, before the next releases, would still be good. The simulated click is needed, at least on Windows, where selection_clear does not completely clear physical click selections. The more direct code I would have preferred would have been 3 lines instead of 5. |
|
The patch to idlelib/help.html included changes to idle.rst in #18771 that were not propagated. |
Lib/idlelib/editor.py
Outdated
| return "break" | ||
| text.mark_set("insert", "%d.0" % lineno) | ||
| newindex = f'{lineno}.0' | ||
| text.mark_set("insert", newindex ) |
There was a problem hiding this comment.
Rogue extra space after newindex.
There was a problem hiding this comment.
In response to next comment, I reverted mark_set change.
|
There's a |
|
I was not currently aware of it. Since I want .see after .mark_set, I pulled in .tag_remove, which for some reason I did not think was working. But it does here. Thank you. |
csabella
left a comment
There was a problem hiding this comment.
LGTM. This works on Ubuntu.
|
Thanks @terryjreedy for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8. |
…nGH-18801) It appears standard that moving the text insert cursor away from a selection clears the selection. Clearing prevents accidental deletion of a possibly off-screen bit of text. The update is for Ln and Col on the status bar. (cherry picked from commit 2522db1) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
|
GH-18857 is a backport of this pull request to the 3.8 branch. |
|
GH-18858 is a backport of this pull request to the 3.7 branch. |
…nGH-18801) It appears standard that moving the text insert cursor away from a selection clears the selection. Clearing prevents accidental deletion of a possibly off-screen bit of text. The update is for Ln and Col on the status bar. (cherry picked from commit 2522db1) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
) It appears standard that moving the text insert cursor away from a selection clears the selection. Clearing prevents accidental deletion of a possibly off-screen bit of text. The update is for Ln and Col on the status bar. (cherry picked from commit 2522db1) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
) It appears standard that moving the text insert cursor away from a selection clears the selection. Clearing prevents accidental deletion of a possibly off-screen bit of text. The update is for Ln and Col on the status bar. (cherry picked from commit 2522db1) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
|
I should remember to use Module Browser to scan the 100+ EditorWindow methods. |
Clearing any selection prevents accidental deletion.
The update is for Ln and Col on the status bar.
https://bugs.python.org/issue39852