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.
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 @@
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):