diff options
author | Terry Jan Reedy <tjreedy@udel.edu> | 2020-03-08 18:32:42 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-08 18:32:42 (GMT) |
commit | 2522db11df102be3baf25ce9e816ebe8ffdb7fcc (patch) | |
tree | 786501887326cf15cfb7b7b185ae6b838267ec6b /Lib/idlelib/editor.py | |
parent | c580981ba01c4d9f721dbdd88208ba37704e0217 (diff) | |
download | cpython-2522db11df102be3baf25ce9e816ebe8ffdb7fcc.zip cpython-2522db11df102be3baf25ce9e816ebe8ffdb7fcc.tar.gz cpython-2522db11df102be3baf25ce9e816ebe8ffdb7fcc.tar.bz2 |
bpo-39852: IDLE 'Go to line' deletes selection, updates status (GH-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.
Diffstat (limited to 'Lib/idlelib/editor.py')
-rw-r--r-- | Lib/idlelib/editor.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/idlelib/editor.py b/Lib/idlelib/editor.py index 04c786d..5b81b52 100644 --- a/Lib/idlelib/editor.py +++ b/Lib/idlelib/editor.py @@ -678,8 +678,11 @@ class EditorWindow(object): if lineno <= 0: text.bell() return "break" - text.mark_set("insert", "%d.0" % lineno) + + text.tag_remove("sel", "1.0", "end") + text.mark_set("insert", f'{lineno}.0') text.see("insert") + self.set_line_and_column() return "break" def open_module(self): |