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 4ca060d8ad)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
This commit is contained in:
Miss Islington (bot) 2020-03-08 12:46:38 -07:00 committed by GitHub
parent ec61f53243
commit f9684d222e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 0 deletions

View File

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

View File

@ -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()

View File

@ -0,0 +1,2 @@
Since clicking to get an IDLE context menu moves the cursor,
any text selection should be and now is cleared.