From 24709c668a4f4a7695e4a2bb1a9b8ec8839dc626 Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Sun, 8 Mar 2020 14:47:54 -0400 Subject: [PATCH 1/2] bpo-39885: IDLE context menu clears selection Since clicking to get an IDLE context menu moves the cursor, any text selection should be and now is cleared. --- Lib/idlelib/editor.py | 1 + Misc/NEWS.d/next/IDLE/2020-03-08-14-27-36.bpo-39885.29ERiR.rst | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 Misc/NEWS.d/next/IDLE/2020-03-08-14-27-36.bpo-39885.29ERiR.rst diff --git a/Lib/idlelib/editor.py b/Lib/idlelib/editor.py index 04c786dc5234c2..434444ae873c70 100644 --- a/Lib/idlelib/editor.py +++ b/Lib/idlelib/editor.py @@ -499,6 +499,7 @@ def handle_yview(self, event, *args): 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() diff --git a/Misc/NEWS.d/next/IDLE/2020-03-08-14-27-36.bpo-39885.29ERiR.rst b/Misc/NEWS.d/next/IDLE/2020-03-08-14-27-36.bpo-39885.29ERiR.rst new file mode 100644 index 00000000000000..f0f434ad3c1f41 --- /dev/null +++ b/Misc/NEWS.d/next/IDLE/2020-03-08-14-27-36.bpo-39885.29ERiR.rst @@ -0,0 +1,2 @@ +Since clicking to get an IDLE context menu moves the cursor, +any text selection should be and now is cleared. From aa93b3c2be7516433ff45f35a6dcf11a0a98188b Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Sun, 8 Mar 2020 14:54:52 -0400 Subject: [PATCH 2/2] IDLE NEWS item. --- Lib/idlelib/NEWS.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt index 1e6cd4580ea7bc..b88b1e3cbffdc4 100644 --- a/Lib/idlelib/NEWS.txt +++ b/Lib/idlelib/NEWS.txt @@ -3,6 +3,9 @@ Released on 2020-10-05? ====================================== +bpo-39885: Since clicking to get an IDLE context menu moves the +cursor, any text selection should be and now is cleared. + bpo-39852: Edit "Go to line" now clears any selection, preventing accidental deletion. It also updates Ln and Col on the status bar.