summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/idle_test/test_codecontext.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2020-02-28 18:43:25 (GMT)
committerGitHub <noreply@github.com>2020-02-28 18:43:25 (GMT)
commit846ca4961da24669e6e0c901986e66ff485917b2 (patch)
tree0d2c71478e04c7e4568dddadf117a45dbeda1830 /Lib/idlelib/idle_test/test_codecontext.py
parent343bc06d8047e4a2e675394528dbb5155be1b3b5 (diff)
downloadcpython-846ca4961da24669e6e0c901986e66ff485917b2.zip
cpython-846ca4961da24669e6e0c901986e66ff485917b2.tar.gz
cpython-846ca4961da24669e6e0c901986e66ff485917b2.tar.bz2
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 (cherry picked from commit c705fd1e89ccb8f6d414ec817b4616546147d877) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
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 3ec49e9..9578cc73 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.