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.
This commit is contained in:
Terry Jan Reedy 2020-03-08 15:30:04 -04:00 committed by GitHub
parent 2522db11df
commit 4ca060d8ad
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 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 bpo-39852: Edit "Go to line" now clears any selection, preventing
accidental deletion. It also updates Ln and Col on the status bar. accidental deletion. It also updates Ln and Col on the status bar.

View File

@ -499,6 +499,7 @@ class EditorWindow(object):
rmenu = None rmenu = None
def right_menu_event(self, event): 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)) self.text.mark_set("insert", "@%d,%d" % (event.x, event.y))
if not self.rmenu: if not self.rmenu:
self.make_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.