summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2020-03-08 19:47:05 (GMT)
committerGitHub <noreply@github.com>2020-03-08 19:47:05 (GMT)
commitb2e8240261aa879b8978d7add6dd1efc4318add1 (patch)
tree11997ee21bca718b0e7f1c7045eec8887703f232 /Lib/idlelib
parenta5e821c7269ebed6e8b4b4eee3f2247ec41a9788 (diff)
downloadcpython-b2e8240261aa879b8978d7add6dd1efc4318add1.zip
cpython-b2e8240261aa879b8978d7add6dd1efc4318add1.tar.gz
cpython-b2e8240261aa879b8978d7add6dd1efc4318add1.tar.bz2
bpo-39885: IDLE context menu clears selection (GH-18859)
Since clicking to get an IDLE context menu moves the cursor, any text selection should be and now is cleared. (cherry picked from commit 4ca060d8ad7c6df1fd4df30f9a14f6aa35380c09) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Diffstat (limited to 'Lib/idlelib')
-rw-r--r--Lib/idlelib/NEWS.txt3
-rw-r--r--Lib/idlelib/editor.py1
2 files changed, 4 insertions, 0 deletions
diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt
index 8493192..83930f7 100644
--- a/Lib/idlelib/NEWS.txt
+++ b/Lib/idlelib/NEWS.txt
@@ -3,6 +3,9 @@ Released on 2019-12-16?
======================================
+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.
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 @@ class EditorWindow(object):
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()