Skip to content

Commit 4ca060d

Browse files
authored
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.
1 parent 2522db1 commit 4ca060d

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

Lib/idlelib/NEWS.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ Released on 2020-10-05?
33
======================================
44

55

6+
bpo-39885: Since clicking to get an IDLE context menu moves the
7+
cursor, any text selection should be and now is cleared.
8+
69
bpo-39852: Edit "Go to line" now clears any selection, preventing
710
accidental deletion. It also updates Ln and Col on the status bar.
811

Lib/idlelib/editor.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,7 @@ def handle_yview(self, event, *args):
499499
rmenu = None
500500

501501
def right_menu_event(self, event):
502+
self.text.tag_remove("sel", "1.0", "end")
502503
self.text.mark_set("insert", "@%d,%d" % (event.x, event.y))
503504
if not self.rmenu:
504505
self.make_rmenu()
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Since clicking to get an IDLE context menu moves the cursor,
2+
any text selection should be and now is cleared.

0 commit comments

Comments
 (0)