summaryrefslogtreecommitdiff
path: root/Lib/idlelib/idle_test/test_codecontext.py
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2020-02-28 13:22:55 -0500
committerGitHub <noreply@github.com>2020-02-28 13:22:55 -0500
commitc705fd1e89ccb8f6d414ec817b4616546147d877 (patch)
tree8b2161ff8c811747c6c3aa17d281c00dc15fe4d3 /Lib/idlelib/idle_test/test_codecontext.py
parent4f17c5cd9a1ec50fe8de7ef68c39220a01a862cb (diff)
downloadcpython-git-c705fd1e89ccb8f6d414ec817b4616546147d877.tar.gz
bpo-39781: Do not jump when select in IDLE codecontext (GH-18683)
Previously, the button-up part of selecting with a mouse was treated as a click that meant 'jump' to this line, which modified the context and undid the selection
Diffstat (limited to 'Lib/idlelib/idle_test/test_codecontext.py')
-rw-r--r--Lib/idlelib/idle_test/test_codecontext.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/idlelib/idle_test/test_codecontext.py b/Lib/idlelib/idle_test/test_codecontext.py
index 3ec49e97af..9578cc731a 100644
--- a/Lib/idlelib/idle_test/test_codecontext.py
+++ b/Lib/idlelib/idle_test/test_codecontext.py
@@ -332,6 +332,14 @@ class CodeContextTest(unittest.TestCase):
jump()
eq(cc.topvisible, 8)
+ # Context selection stops jump.
+ cc.text.yview('5.0')
+ cc.update_code_context()
+ cc.context.tag_add('sel', '1.0', '2.0')
+ cc.context.mark_set('insert', '1.0')
+ jump() # Without selection, to line 2.
+ eq(cc.topvisible, 5)
+
@mock.patch.object(codecontext.CodeContext, 'update_code_context')
def test_timer_event(self, mock_update):
# Ensure code context is not active.