diff options
author | Terry Jan Reedy <tjreedy@udel.edu> | 2020-03-08 19:30:04 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-08 19:30:04 (GMT) |
commit | 4ca060d8ad7c6df1fd4df30f9a14f6aa35380c09 (patch) | |
tree | 98ed28d77a76cf19434ec03a464b2fb862d515e4 /Lib/idlelib | |
parent | 2522db11df102be3baf25ce9e816ebe8ffdb7fcc (diff) | |
download | cpython-4ca060d8ad7c6df1fd4df30f9a14f6aa35380c09.zip cpython-4ca060d8ad7c6df1fd4df30f9a14f6aa35380c09.tar.gz cpython-4ca060d8ad7c6df1fd4df30f9a14f6aa35380c09.tar.bz2 |
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.
Diffstat (limited to 'Lib/idlelib')
-rw-r--r-- | Lib/idlelib/NEWS.txt | 3 | ||||
-rw-r--r-- | Lib/idlelib/editor.py | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt index 1e6cd45..b88b1e3 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. 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() |