bpo-39885: IDLE context menu clears selection (#18859)
Since clicking to get an IDLE context menu moves the cursor,
any text selection should be and now is cleared.
diff --git a/Lib/idlelib/editor.py b/Lib/idlelib/editor.py
index 5b81b52..5194190 100644
--- a/Lib/idlelib/editor.py
+++ b/Lib/idlelib/editor.py
@@ -499,6 +499,7 @@
rmenu = None
def right_menu_event(self, event):
+ self.text.tag_remove("sel", "1.0", "end")
self.text.mark_set("insert", "@%d,%d" % (event.x, event.y))
if not self.rmenu:
self.make_rmenu()